Add function method to aggregate areas

This is standalone for now - we'll plumb it in later.
This commit is contained in:
Ben Thorner
2021-08-24 15:01:53 +01:00
parent 12978f0a9a
commit a210d87dee
4 changed files with 101 additions and 0 deletions

View File

@@ -127,6 +127,10 @@ class BroadcastArea(BaseBroadcastArea, SortableMixin):
def ancestors(self):
return list(self._ancestors_iterator)
@cached_property
def parent(self):
return next(iter(self.ancestors), None)
@property
def _ancestors_iterator(self):
id = self.id