mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
11029 add changelog on CableTermination (#11407)
* 11209 add changelog on CableTermination * Rename migration --------- Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user