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:
@ -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
|
||||
|
Reference in New Issue
Block a user