From 92567137a593f51e7761665ca554215d291164e9 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 19 Apr 2019 13:32:46 -0400 Subject: [PATCH] PowerFeed list improvements --- netbox/dcim/forms.py | 2 +- netbox/dcim/tables.py | 7 ++++++- netbox/dcim/views.py | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index a2358ab6e..f95b4b18b 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -3425,7 +3425,7 @@ class PowerPanelFilterForm(BootstrapMixin, CustomFieldFilterForm): api_url="/api/dcim/sites/", value_field="slug", filter_for={ - 'rack_id': 'site', + 'rack_group_id': 'site', } ) ) diff --git a/netbox/dcim/tables.py b/netbox/dcim/tables.py index 03f77fc4a..49cd22e10 100644 --- a/netbox/dcim/tables.py +++ b/netbox/dcim/tables.py @@ -189,6 +189,10 @@ CABLE_LENGTH = """ {% if record.length %}{{ record.length }} {{ record.get_length_unit_display }}{% else %}—{% endif %} """ +POWERPANEL_POWERFEED_COUNT = """ +{{ value }} +""" + # # Regions @@ -804,7 +808,8 @@ class PowerPanelTable(BaseTable): viewname='dcim:site', args=[Accessor('site.slug')] ) - powerfeed_count = tables.Column( + powerfeed_count = tables.TemplateColumn( + template_code=POWERPANEL_POWERFEED_COUNT, verbose_name='Feeds' ) diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 29408620b..c82f795b5 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -13,8 +13,6 @@ from django.urls import reverse from django.utils.html import escape from django.utils.http import is_safe_url from django.utils.safestring import mark_safe -from django.utils.decorators import method_decorator -from django.views.decorators.cache import cache_page from django.views.generic import View from circuits.models import Circuit