feat(models): add property parent_object to models that have a parent

!22
This commit is contained in:
2024-06-10 00:49:19 +09:30
parent 11ec62feb6
commit fe0696fee6
12 changed files with 417 additions and 38 deletions

View File

@ -212,6 +212,13 @@ class DeviceSoftware(DeviceCommonFields, SaveHistory):
)
@property
def parent_object(self):
""" Fetch the parent object """
return self.device
class DeviceOperatingSystem(DeviceCommonFields, SaveHistory):
@ -247,3 +254,10 @@ class DeviceOperatingSystem(DeviceCommonFields, SaveHistory):
blank = True,
default = None,
)
@property
def parent_object(self):
""" Fetch the parent object """
return self.device