1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Record wireless links as part of cable path

This commit is contained in:
jeremystretch
2021-10-13 13:28:14 -04:00
parent 445e16f668
commit 138af27bf7
5 changed files with 59 additions and 38 deletions

View File

@ -157,6 +157,13 @@ class CableTermination(models.Model):
def parent_object(self):
raise NotImplementedError("CableTermination models must implement parent_object()")
@property
def link(self):
"""
Generic wrapper for a Cable, WirelessLink, or some other relation to a connected termination.
"""
return self.cable
class PathEndpoint(models.Model):
"""
@ -657,6 +664,10 @@ class Interface(ComponentModel, BaseInterface, CableTermination, PathEndpoint):
def is_lag(self):
return self.type == InterfaceTypeChoices.TYPE_LAG
@property
def link(self):
return self.cable or self.wireless_link
#
# Pass-through ports