|
|
@@ -13,7 +13,8 @@ from dcim.choices import *
|
|
|
from dcim.constants import *
|
|
|
from dcim.fields import PathField
|
|
|
from dcim.utils import decompile_path_node, object_to_path_node
|
|
|
-from netbox.models import PrimaryModel
|
|
|
+from netbox.models import ChangeLoggedModel, PrimaryModel
|
|
|
+
|
|
|
from utilities.fields import ColorField
|
|
|
from utilities.querysets import RestrictedQuerySet
|
|
|
from utilities.utils import to_meters
|
|
|
@@ -222,7 +223,7 @@ class Cable(PrimaryModel):
|
|
|
return LinkStatusChoices.colors.get(self.status)
|
|
|
|
|
|
|
|
|
-class CableTermination(models.Model):
|
|
|
+class CableTermination(ChangeLoggedModel):
|
|
|
"""
|
|
|
A mapping between side A or B of a Cable and a terminating object (e.g. an Interface or CircuitTermination).
|
|
|
"""
|
|
|
@@ -359,6 +360,11 @@ class CableTermination(models.Model):
|
|
|
elif getattr(self.termination, 'site', None):
|
|
|
self._site = self.termination.site
|
|
|
|
|
|
+ def to_objectchange(self, action):
|
|
|
+ objectchange = super().to_objectchange(action)
|
|
|
+ objectchange.related_object = self.termination
|
|
|
+ return objectchange
|
|
|
+
|
|
|
|
|
|
class CablePath(models.Model):
|
|
|
"""
|