<s> from django . db import models <EOL> from django . contrib . auth . models import User <EOL> class Country ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> Code = models . CharField ( max_length = <NUM_LIT:3> ) <EOL> def __unicode__ ( self ) : <EOL> return self . Code <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT:Name>' ] <EOL> class County ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT> ) <EOL> Country = models . ForeignKey ( '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT:Name>' ] <EOL> class Address ( models . Model ) : <EOL> LineOne = models . CharField ( max_length = <NUM_LIT> ) <EOL> LineTwo = models . CharField ( max_length = <NUM_LIT> , blank = True ) <EOL> LineThree = models . CharField ( max_length = <NUM_LIT> , blank = True ) <EOL> Postcode = models . CharField ( max_length = <NUM_LIT:15> ) <EOL> County = models . ForeignKey ( '<STR_LIT>' ) <EOL> Country = models . ForeignKey ( '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . LineOne , self . County , self . Postcode ) <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT>' ] <EOL> class Company ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> HeadOffice = models . ForeignKey ( '<STR_LIT>' ) <EOL> SupportNumber = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> SupportEmail = models . EmailField ( ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT:Name>' ] <EOL> class Contact ( models . Model ) : <EOL> TITLE_CHOICES = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) <EOL> Title = models . CharField ( max_length = <NUM_LIT:6> , choices = TITLE_CHOICES ) <EOL> FirstName = models . CharField ( max_length = <NUM_LIT> ) <EOL> LastName = models . CharField ( max_length = <NUM_LIT> ) <EOL> PrimaryPhone = models . CharField ( max_length = <NUM_LIT:50> ) <EOL> EmailAddress = models . EmailField ( ) <EOL> Company = models . ForeignKey ( '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . Title , self . FirstName , self . LastName ) <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT>' ] <EOL> class DataCentre ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> ShortCode = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> Address = models . ForeignKey ( '<STR_LIT>' ) <EOL> PrincipleContact = models . ForeignKey ( '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return self . ShortCode <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT:Name>' ] <EOL> class DataCentreRoom ( models . Model ) : <EOL> RoomName = models . CharField ( max_length = <NUM_LIT> ) <EOL> DataCentre = models . ForeignKey ( '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . RoomName , self . DataCentre ) <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT>' ] <EOL> class DataCentreSuite ( models . Model ) : <EOL> SuiteName = models . CharField ( max_length = <NUM_LIT> ) <EOL> Room = models . ForeignKey ( '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . SuiteName , self . Room ) <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT>' ] <EOL> class DataCentreRack ( models . Model ) : <EOL> RackName = models . CharField ( max_length = <NUM_LIT> ) <EOL> Room = models . ForeignKey ( '<STR_LIT>' , blank = True ) <EOL> Suite = models . ForeignKey ( '<STR_LIT>' , blank = True ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . RackName , self . Suite , self . Room ) <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT>' ] <EOL> class ConfigurationItemClass ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT:Name>' ] <EOL> class NetworkInterface ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> MacAddress = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> Gateway = models . IPAddressField ( blank = True , null = True ) <EOL> SubnetMask = models . IPAddressField ( blank = True , null = True ) <EOL> IPAddress = models . IPAddressField ( blank = True , null = True ) <EOL> UseDHCP = models . BooleanField ( ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . Name , self . IPAddress , self . MacAddress ) <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT:Name>' ] <EOL> class PackageProvider ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> ExecutableName = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class PackageFormat ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> Provider = models . ForeignKey ( PackageProvider ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class Repo ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> PackageProvider = models . ForeignKey ( PackageProvider ) <EOL> url = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class OperatingSystemBreed ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> PackageFormat = models . ForeignKey ( PackageFormat ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class OperatingSystemName ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:200> ) <EOL> SupportCompany = models . ForeignKey ( Company ) <EOL> Breed = models . ForeignKey ( OperatingSystemBreed ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . Name , self . SupportCompany ) <EOL> class OperatingSystemVersion ( models . Model ) : <EOL> Name = models . ForeignKey ( OperatingSystemName ) <EOL> Version = models . CharField ( max_length = <NUM_LIT> ) <EOL> EOLDate = models . DateField ( blank = True , null = True , verbose_name = '<STR_LIT>' ) <EOL> EOSDate = models . DateField ( blank = True , null = True , verbose_name = '<STR_LIT>' ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . Name , self . Version ) <EOL> class VirtualisationType ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT> ) <EOL> Description = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT:Name>' ] <EOL> class VirtualServerDefinition ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> NumCPU = models . IntegerField ( max_length = <NUM_LIT:4> ) <EOL> RamMB = models . IntegerField ( max_length = <NUM_LIT:7> ) <EOL> DeployTo = models . ForeignKey ( '<STR_LIT>' , null = True , blank = True ) <EOL> DiskSizeGB = models . IntegerField ( default = <NUM_LIT:8> , max_length = <NUM_LIT:7> ) <EOL> POWER_CHOICES = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> OnReboot = models . CharField ( max_length = <NUM_LIT> , choices = POWER_CHOICES ) <EOL> OnCrash = models . CharField ( max_length = <NUM_LIT> , choices = POWER_CHOICES ) <EOL> OnPowerOff = models . CharField ( max_length = <NUM_LIT> , choices = POWER_CHOICES ) <EOL> Acpi = models . BooleanField ( ) <EOL> Pae = models . BooleanField ( ) <EOL> NETWORK_CHOICES = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT:user>' , '<STR_LIT>' ) , <EOL> ) <EOL> NetworkType = models . CharField ( max_length = <NUM_LIT:10> , choices = NETWORK_CHOICES ) <EOL> BridgeNetworkInterface = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> VMType = models . ForeignKey ( VirtualisationType ) <EOL> def __unicode__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . Name , self . NumCPU , self . RamMB , self . DiskSizeGB , self . NetworkType , self . BridgeNetworkInterface , self . VMType ) <EOL> class ConfigurationItemProfile ( models . Model ) : <EOL> Name = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> VirtualServerDefinition = models . ForeignKey ( VirtualServerDefinition , blank = True , null = True ) <EOL> OperatingSystem = models . ForeignKey ( OperatingSystemVersion ) <EOL> AutoInstallFile = models . TextField ( help_text = "<STR_LIT>" ) <EOL> repos = models . ManyToManyField ( Repo , blank = True , null = True ) <EOL> def __unicode__ ( self ) : <EOL> return self . Name <EOL> class ConfigurationItem ( models . Model ) : <EOL> Hostname = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> Rack = models . ForeignKey ( '<STR_LIT>' ) <EOL> Asset = models . CharField ( max_length = <NUM_LIT> ) <EOL> SupportTag = models . CharField ( max_length = <NUM_LIT> ) <EOL> Class = models . ForeignKey ( ConfigurationItemClass ) <EOL> Owner = models . ForeignKey ( User ) <EOL> NetworkInterface = models . ManyToManyField ( NetworkInterface ) <EOL> Profile = models . ForeignKey ( ConfigurationItemProfile ) <EOL> VMImagePath = models . CharField ( max_length = <NUM_LIT:255> , blank = True , null = True , verbose_name = '<STR_LIT>' ) <EOL> IsVirtual = models . BooleanField ( ) <EOL> BuildOnNextBoot = models . BooleanField ( verbose_name = "<STR_LIT>" , help_text = "<STR_LIT>" ) <EOL> IsVMHost = models . BooleanField ( ) <EOL> rootpwhash = models . CharField ( max_length = <NUM_LIT:255> ) <EOL> def __unicode__ ( self ) : <EOL> return self . Hostname <EOL> class Meta : <EOL> verbose_name = '<STR_LIT>' <EOL> verbose_name_plural = '<STR_LIT>' <EOL> ordering = [ '<STR_LIT>' ] </s>
