- Timestamp:
- Dec 23, 2008, 12:53:26 AM (16 years ago)
- Location:
- trunk/exodus
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exodus/admin.py
r6437 r6479 23 23 24 24 class InterfaceAdmin(ReadOnlyAdminFields, admin.ModelAdmin): 25 #readonly = ('ip', 'netmask', 'mode', 'ssid', 'shortdesc', 'desc')25 readonly = ('ip', 'netmask', 'mode', 'ssid', 'shortdesc', 'desc') 26 26 form = InterfaceForm 27 27 list_display = ('node', 'iface', 'type', 'ip', 'channel', 'polar', … … 30 30 list_filter = ('type', 'accesspoint', 'polar', 'node', 'antenna') 31 31 ordering =('node',) 32 fieldsets = ( 33 (None, { 34 'fields' : ('node', 'iface', 'type', ('ip', 'netmask'), 'link')}), 35 ('Wireless', { 36 'fields' : ('ssid', 'channel', 'antenna', 'polar', 'mode')}), 37 ('Description', { 38 'fields' : (('shortdesc', 'desc'))} 39 )) 32 40 33 41 advanced_admin.register(Antenna) -
trunk/exodus/forms.py
r6478 r6479 238 238 raise forms.ValidationError( 239 239 "Not enough free ips for this node.") 240 import pdb; pdb.set_trace() ;241 240 new_ip.ips.reverse() 242 241 ip = new_ip.ips.pop() -
trunk/exodus/models.py
r6477 r6479 106 106 107 107 class Meta: 108 #unique_together = ('node', 'iface')108 unique_together = ('node', 'iface') 109 109 verbose_name = 'Interface' 110 110 … … 115 115 super(Interface, self).save(force_insert, force_update) 116 116 # If link is not defined we link to self. 117 #XXX: need to assign an IP address in forms.118 117 if not self.link: 119 118 self.link = self 120 119 super(Interface, self).save(False, True) 121 120 122 123 #124 # XXX: Currently not used, require rethinking wether we _really_ still needs125 # this feature as we going to use a new interlink IP naming model126 #class InterfaceAlias(models.Model):127 # iface = models.ForeignKey(Interface,related_name='child')128 # ip = models.IPAddressField(unique=True)129 # netmask = models.IntegerField(default=30)130 # shortdesc = models.CharField(blank=True, max_length=10)131 # desc = models.CharField(blank=True, max_length=100)132 # linkAlias = models.ForeignKey('self', blank=True, null=True)133 # link = models.ForeignKey(Interface, blank=True, null=True)134 #135 # def __unicode__(self):136 # return "Alias %s" % (self.iface)137 #138 #139 # XXX: Needs rethinking, dhcp[start|stop] could be removed if whole publicAP is140 # going to be activated as DHCP range, or only number of fixed clients needs to141 # be defined, all other could be calculated on the fly if needed142 143 #class PublicAP(models.Model):144 # iface = models.ForeignKey(Interface,related_name='ap', verbose_name="interface")145 # ip = models.IPAddressField(unique=True)146 # netmask = models.IntegerField(default=28)147 # dhcpstart = models.IPAddressField()148 # dhcpstop = models.IPAddressField()149 # shortdesc = models.CharField(max_length=10)150 # desc = models.CharField(max_length=100)151 #152 # class Meta:153 # verbose_name = "Public Access Point"154 #155 # def __unicode__(self):156 # return "%s:%s" % (self.iface,self.pk)157 121 158 122 class DhcpStatic(models.Model): … … 162 126 public_accesspoint = models.ForeignKey(Interface) 163 127 164 165 128 class Meta: 166 129 verbose_name = "Static host"
Note:
See TracChangeset
for help on using the changeset viewer.