remove the nets property from the Device model
since we remove the grouping function from the device details we don't need it anmore.
This commit is contained in:
parent
e1a5c572d8
commit
696356bd8a
|
@ -59,19 +59,6 @@ class Device(models.Model):
|
|||
installation_date = models.DateField(null=True, blank=True)
|
||||
net = models.ManyToManyField(Net, through='DeviceInNet')
|
||||
|
||||
@property
|
||||
def nets(self):
|
||||
nets_result = DeviceInNet.objects.filter(
|
||||
device=self.id).order_by('net')
|
||||
nets = []
|
||||
for net in nets_result:
|
||||
ip_addresses = {}
|
||||
ip_addresses['net_id'] = net.net.id
|
||||
ip_addresses['ip'] = str(net)
|
||||
ip_addresses['name'] = net.net.name
|
||||
nets.append(ip_addresses)
|
||||
return nets
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
|
Loading…
Reference in New Issue