+
Tenant
@@ -72,8 +72,6 @@
-
-
Comments
@@ -86,6 +84,41 @@
{% endif %}
+
+
{% endblock %}
diff --git a/netbox/tenancy/admin.py b/netbox/tenancy/admin.py
index d381b88ff..efd0d2ac8 100644
--- a/netbox/tenancy/admin.py
+++ b/netbox/tenancy/admin.py
@@ -16,7 +16,7 @@ class TenantAdmin(admin.ModelAdmin):
prepopulated_fields = {
'slug': ['name'],
}
- list_display = ['name', 'slug', 'group']
+ list_display = ['name', 'slug', 'group', 'description']
def get_queryset(self, request):
qs = super(TenantAdmin, self).get_queryset(request)
diff --git a/netbox/tenancy/views.py b/netbox/tenancy/views.py
index db8befedf..0cf10aa80 100644
--- a/netbox/tenancy/views.py
+++ b/netbox/tenancy/views.py
@@ -50,7 +50,14 @@ class TenantListView(ObjectListView):
def tenant(request, slug):
- tenant = get_object_or_404(Tenant, slug=slug)
+ tenant = get_object_or_404(Tenant.objects.annotate(
+ site_count=Count('sites', distinct=True),
+ rack_count=Count('racks', distinct=True),
+ device_count=Count('devices', distinct=True),
+ vrf_count=Count('vrfs', distinct=True),
+ vlan_count=Count('vlans', distinct=True),
+ circuit_count=Count('circuits', distinct=True),
+ ), slug=slug)
return render(request, 'tenancy/tenant.html', {
'tenant': tenant,