Closes #6109: Add device counts to locations table

This commit is contained in:
jeremystretch
2021-04-08 10:08:50 -04:00
parent 4f7626828a
commit 05d8a06cd5
4 changed files with 47 additions and 34 deletions

View File

@@ -338,12 +338,18 @@ class SiteBulkDeleteView(generic.BulkDeleteView):
#
# Rack groups
# Locations
#
class LocationListView(generic.ObjectListView):
queryset = Location.objects.add_related_count(
Location.objects.all(),
Location.objects.add_related_count(
Location.objects.all(),
Device,
'location',
'device_count',
cumulative=True
),
Rack,
'location',
'rack_count',