mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #9151: Child prefix counts not annotated on aggregates list under RIR view
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#9133](https://github.com/netbox-community/netbox/issues/9133) - Upgrade script should require Python 3.8 or later
|
* [#9133](https://github.com/netbox-community/netbox/issues/9133) - Upgrade script should require Python 3.8 or later
|
||||||
|
* [#9151](https://github.com/netbox-community/netbox/issues/9151) - Child prefix counts not annotated on aggregates list under RIR view
|
||||||
* [#9156](https://github.com/netbox-community/netbox/issues/9156) - Fix loading UserConfig data from fixtures
|
* [#9156](https://github.com/netbox-community/netbox/issues/9156) - Fix loading UserConfig data from fixtures
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -158,8 +158,8 @@ class RIRView(generic.ObjectView):
|
|||||||
queryset = RIR.objects.all()
|
queryset = RIR.objects.all()
|
||||||
|
|
||||||
def get_extra_context(self, request, instance):
|
def get_extra_context(self, request, instance):
|
||||||
aggregates = Aggregate.objects.restrict(request.user, 'view').filter(
|
aggregates = Aggregate.objects.restrict(request.user, 'view').filter(rir=instance).annotate(
|
||||||
rir=instance
|
child_count=RawSQL('SELECT COUNT(*) FROM ipam_prefix WHERE ipam_prefix.prefix <<= ipam_aggregate.prefix', ())
|
||||||
)
|
)
|
||||||
aggregates_table = tables.AggregateTable(aggregates, exclude=('rir', 'utilization'))
|
aggregates_table = tables.AggregateTable(aggregates, exclude=('rir', 'utilization'))
|
||||||
aggregates_table.configure(request)
|
aggregates_table.configure(request)
|
||||||
|
Reference in New Issue
Block a user