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

@ -106,6 +106,13 @@ class Team(Group, TenancyObject, SaveHistory):
modified = AutoLastModifiedField()
@property
def parent_object(self):
""" Fetch the parent object """
return self.organization
def permission_list(self) -> list:
permission_list = []
@ -190,3 +197,10 @@ class TeamUsers(SaveHistory):
user.groups.add(group)
@property
def parent_object(self):
""" Fetch the parent object """
return self.team