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

Location model cleanup

This commit is contained in:
jeremystretch
2021-04-05 11:04:12 -04:00
parent 4883bc3dd4
commit 7b8bd2d4ce
6 changed files with 34 additions and 14 deletions

View File

@@ -272,6 +272,13 @@ class SiteView(generic.ObjectView):
'location',
'rack_count',
cumulative=True
)
locations = Location.objects.add_related_count(
locations,
Device,
'location',
'device_count',
cumulative=True
).restrict(request.user, 'view').filter(site=instance)
return {