Changeset 12967
- Timestamp:
- 05/10/11 16:24:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sara_cmt/sara_cmt/cluster/models.py
r12953 r12967 27 27 28 28 class Cluster(ModelExtension): 29 """ 30 A labeled group of hardware pieces. 31 """ 29 32 name = models.CharField(max_length=255, unique=True) 30 33 … … 32 35 ordering = ('name',) 33 36 34 def __unicode__(self): 37 def __unicode__(self):nam 35 38 return self.name or None 36 39 37 40 38 41 class HardwareUnit(ModelExtension): 42 """ 43 A specific piece of hardware. 44 """ 39 45 cluster = models.ForeignKey('Cluster', related_name='hardware') 40 46 role = models.ManyToManyField('Role', related_name='hardware') … … 123 129 124 130 class Interface(ModelExtension): 131 """ 132 An interface of a piece of hardware. 133 """ 125 134 re_valid_mac = re.compile(r'([A-Fa-f\d]{2}[:-]?){5}[A-Fa-f\d]{2}') 126 135 re_mac_octets = re.compile(r'[A-Fa-f\d]{2}') … … 334 343 """ 335 344 A Rack is a standardized system for mounting various HardwareUnits in a 336 stack of slots. It is located on a site.345 stack of slots. 337 346 """ 338 347 … … 407 416 408 417 class Room(ModelExtension): 418 """ 419 A room is located at an address. This is where racks of hardware can be 420 found. 421 """ 409 422 address = models.ForeignKey(Address, related_name='rooms') 410 423 … … 440 453 addresses = models.ManyToManyField(Address, related_name='_companies') 441 454 442 #type = models.ChoiceField() # !!! TODO: add choices like vendor / support / partner / etc... !!!455 #type = models.ChoiceField() # !!! TODO: add choices like vendor / support / partner / customer / etc... !!! 443 456 name = models.CharField(max_length=255) 444 457 website = models.URLField() … … 481 494 482 495 class Telephonenumber(ModelExtension): 496 """ 497 Telephonenumber to link to a contact. Split in country-, area- and 498 subscriber-part for easy filtering. 499 """ 483 500 NUMBER_CHOICES = ( 484 501 ('T', 'Telephone'), … … 515 532 class HardwareModel(ModelExtension): 516 533 """ 517 Th e Model-model is being used to specify some extra information about a534 This model is being used to specify some extra information about a 518 535 specific type (model) of hardware. 519 536 """ … … 552 569 553 570 class InterfaceType(ModelExtension): 571 """ 572 Contains information about different types of interfaces. 573 """ 574 vendor = models.ForeignKey('Company', null=True, blank=True, related_name='interfaces') 575 554 576 label = models.CharField(max_length=255, help_text="'DRAC 4' for example") 555 vendor = models.ForeignKey('Company', null=True, blank=True, related_name='interfaces')556 577 557 578 class Meta: … … 582 603 class WarrantyType(ModelExtension): 583 604 """ 584 A type of warranty offered by a company.605 A type of warranty offered by a company. 585 606 """ 586 607 contact = models.ForeignKey(Connection, related_name='warranty types')
Note: See TracChangeset
for help on using the changeset viewer.