Changeset 6428
- Timestamp:
- Dec 10, 2008, 1:47:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exodus/models.py
r6424 r6428 9 9 10 10 STATUS_CHOICES = ( 11 12 13 14 15 11 ('up', 'up'), 12 ('dw', 'down'), 13 ('pl', 'planned'), 14 ) 15 16 16 POLAR_CHOICES = ( 17 18 19 17 ('hr', 'horizontal'), 18 ('vr', 'vertical'), 19 ) 20 20 21 21 INTERFACE_TYPE_CHOICES = ( 22 23 24 25 26 22 ('eth', 'eth'), 23 ('11a', '11a'), 24 ('11b', '11b'), 25 ('11g', '11g'), 26 ) 27 27 WIFI_MODE_CHOICES = ( 28 29 30 28 ('ms', 'master'), 29 ('mn', 'managed'), 30 ) 31 31 32 32 class Antenna(models.Model): … … 64 64 65 65 class Network(models.Model): 66 67 68 66 name = models.CharField(max_length=50, unique=True) 67 ipspacestart = models.IPAddressField() 68 netmask = models.IntegerField() 69 69 70 70 class Meta: 71 71 verbose_name = 'Network' 72 72 73 74 73 def __unicode__(self): 74 return self.name 75 75 76 76 class Node(models.Model): … … 104 104 105 105 class Interface(models.Model): 106 107 106 node = models.ForeignKey(Node) 107 type = models.CharField(max_length=10, choices=INTERFACE_TYPE_CHOICES, \ 108 108 default='eth') 109 109 iface = models.CharField(max_length=10, verbose_name="interface", \ 110 110 default='eth0') 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 111 ip = models.IPAddressField(unique=True, blank=True) 112 netmask = models.IntegerField(default=30) 113 polar = models.CharField(blank=True, max_length=10, choices=POLAR_CHOICES) 114 ssid = models.CharField(max_length=30, blank=True, null=True) 115 mode = models.CharField(max_length=10, choices=WIFI_MODE_CHOICES, blank=True) 116 channel = models.IntegerField(blank=True, null=True) 117 antenna = models.ForeignKey(Antenna, blank=True, null=True) 118 shortdesc = models.CharField(blank=True, max_length=10) 119 desc = models.CharField(blank=True, max_length=100) 120 link = models.ForeignKey('self', blank=True, null=True) 121 122 class Meta: 123 #unique_together = ('node', 'iface') 124 verbose_name = 'Interface' 125 126 def __unicode__(self): 127 return "%s/%s" % (self.node, self.iface) 128 128 129 129 class InterfaceAlias(models.Model): 130 131 132 133 134 135 136 137 138 139 130 iface = models.ForeignKey(Interface,related_name='child') 131 ip = models.IPAddressField(unique=True) 132 netmask = models.IntegerField(default=30) 133 shortdesc = models.CharField(blank=True, max_length=10) 134 desc = models.CharField(blank=True, max_length=100) 135 linkAlias = models.ForeignKey('self', blank=True, null=True) 136 link = models.ForeignKey(Interface, blank=True, null=True) 137 138 def __unicode__(self): 139 return "Alias %s" % (self.iface) 140 140 141 141 #
Note:
See TracChangeset
for help on using the changeset viewer.