Add status field to WirelessLink

This commit is contained in:
jeremystretch
2021-10-13 14:31:30 -04:00
parent ec0560a2c5
commit 95ed07a95e
21 changed files with 80 additions and 37 deletions

View File

@@ -64,8 +64,8 @@ class Cable(PrimaryModel):
)
status = models.CharField(
max_length=50,
choices=CableStatusChoices,
default=CableStatusChoices.STATUS_CONNECTED
choices=LinkStatusChoices,
default=LinkStatusChoices.STATUS_CONNECTED
)
label = models.CharField(
max_length=100,
@@ -285,7 +285,7 @@ class Cable(PrimaryModel):
self._pk = self.pk
def get_status_class(self):
return CableStatusChoices.CSS_CLASSES.get(self.status)
return LinkStatusChoices.CSS_CLASSES.get(self.status)
def get_compatible_types(self):
"""
@@ -390,7 +390,7 @@ class CablePath(BigIDModel):
node = origin
while node.link is not None:
if hasattr(node.link, 'status') and node.link.status != CableStatusChoices.STATUS_CONNECTED:
if hasattr(node.link, 'status') and node.link.status != LinkStatusChoices.STATUS_CONNECTED:
is_active = False
# Follow the link to its far-end termination