Changeset 12967 for trunk


Ignore:
Timestamp:
05/10/11 16:24:41 (13 years ago)
Author:
sil
Message:

added some comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sara_cmt/sara_cmt/cluster/models.py

    r12953 r12967  
    2727
    2828class Cluster(ModelExtension):
     29    """
     30        A labeled group of hardware pieces.
     31    """
    2932    name = models.CharField(max_length=255, unique=True)
    3033
     
    3235        ordering = ('name',)
    3336
    34     def __unicode__(self):
     37    def __unicode__(self):nam
    3538        return self.name or None
    3639
    3740
    3841class HardwareUnit(ModelExtension):
     42    """
     43        A specific piece of hardware.
     44    """
    3945    cluster      = models.ForeignKey('Cluster', related_name='hardware')
    4046    role         = models.ManyToManyField('Role', related_name='hardware')
     
    123129
    124130class Interface(ModelExtension):
     131    """
     132        An interface of a piece of hardware.
     133    """
    125134    re_valid_mac = re.compile(r'([A-Fa-f\d]{2}[:-]?){5}[A-Fa-f\d]{2}')
    126135    re_mac_octets = re.compile(r'[A-Fa-f\d]{2}')
     
    334343    """
    335344        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.
    337346    """
    338347
     
    407416
    408417class Room(ModelExtension):
     418    """
     419        A room is located at an address. This is where racks of hardware can be
     420        found.
     421    """
    409422    address = models.ForeignKey(Address, related_name='rooms')
    410423
     
    440453    addresses = models.ManyToManyField(Address, related_name='_companies')
    441454
    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... !!!
    443456    name    = models.CharField(max_length=255)
    444457    website = models.URLField()
     
    481494
    482495class Telephonenumber(ModelExtension):
     496    """
     497        Telephonenumber to link to a contact. Split in country-, area- and
     498        subscriber-part for easy filtering.
     499    """
    483500    NUMBER_CHOICES = (
    484501        ('T', 'Telephone'),
     
    515532class HardwareModel(ModelExtension):
    516533    """
    517         The Model-model is being used to specify some extra information about a
     534        This model is being used to specify some extra information about a
    518535        specific type (model) of hardware.
    519536    """
     
    552569
    553570class 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
    554576    label = models.CharField(max_length=255, help_text="'DRAC 4' for example")
    555     vendor = models.ForeignKey('Company', null=True, blank=True, related_name='interfaces')
    556577
    557578    class Meta:
     
    582603class WarrantyType(ModelExtension):
    583604    """
    584 A type of warranty offered by a company.
     605        A type of warranty offered by a company.
    585606    """
    586607    contact = models.ForeignKey(Connection, related_name='warranty types')
Note: See TracChangeset for help on using the changeset viewer.