1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Introduce child prefixes view for aggregates

This commit is contained in:
jeremystretch
2021-12-14 16:38:25 -05:00
parent 9a53c22833
commit 85b10b59e4
6 changed files with 140 additions and 97 deletions

View File

@@ -195,6 +195,12 @@ class Aggregate(PrimaryModel):
return self.prefix.version
return None
def get_child_prefixes(self):
"""
Return all Prefixes within this Aggregate
"""
return Prefix.objects.filter(prefix__net_contained=str(self.prefix))
def get_utilization(self):
"""
Determine the prefix utilization of the aggregate and return it as a percentage.