mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #8262 - Add Cable stat for Tenant
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from rest_framework.routers import APIRootView
|
||||
|
||||
from circuits.models import Circuit
|
||||
from dcim.models import Device, Rack, Site
|
||||
from dcim.models import Device, Rack, Site, Cable
|
||||
from extras.api.views import CustomFieldModelViewSet
|
||||
from ipam.models import IPAddress, Prefix, VLAN, VRF
|
||||
from tenancy import filtersets
|
||||
@@ -47,7 +47,8 @@ class TenantViewSet(CustomFieldModelViewSet):
|
||||
site_count=count_related(Site, 'tenant'),
|
||||
virtualmachine_count=count_related(VirtualMachine, 'tenant'),
|
||||
vlan_count=count_related(VLAN, 'tenant'),
|
||||
vrf_count=count_related(VRF, 'tenant')
|
||||
vrf_count=count_related(VRF, 'tenant'),
|
||||
cable_count=count_related(Cable, 'tenant')
|
||||
)
|
||||
serializer_class = serializers.TenantSerializer
|
||||
filterset_class = filtersets.TenantFilterSet
|
||||
|
Reference in New Issue
Block a user