Changeset 6578


Ignore:
Timestamp:
Jan 7, 2009, 9:41:26 PM (16 years ago)
Author:
roland
Message:

Removed feature to only show possible interlinks.
It's not really possible except via javascript.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exodus/models.py

    r6565 r6578  
    127127    direction = models.CharField(max_length=10, blank=True, null=True,
    128128            choices=DIRECTION_CHOICES)
    129     link = models.ForeignKey('self', blank=True, null=True,
    130             limit_choices_to = {'is_master': True })
     129    link = models.ForeignKey('self', blank=True, null=True)
    131130    ip = models.IPAddressField(unique=True, blank=True)
    132131    netmask = models.IntegerField(null=True, blank=True)
     
    135134            blank=True, null=True)
    136135    channel = models.IntegerField(blank=True, null=True)
    137     is_master = models.BooleanField(editable=False)
    138136   
    139137    class Meta:
     
    150148
    151149    def save(self, force_insert=False, force_update=False):
    152         if self.pk == None:
    153             super(Interface, self).save(False, False)
     150        super(Interface, self).save(False, False)
    154151        # If link is not defined we link to self.
    155152        if self.link == None:
    156153            self.link = self
    157         # Master is defined so that only masters show up linkable.
    158         if self.pk == self.link_id:
    159             self.is_master = True
    160             super(Interface, self).save(False, True)
    161         else:
    162             self.is_master=False
    163154            super(Interface, self).save(False, True)
    164155
Note: See TracChangeset for help on using the changeset viewer.