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

Rename Interface type (classification) filter to kind

This commit is contained in:
Jeremy Stretch
2019-04-12 14:09:03 -04:00
parent 4acd842237
commit 533520ec1f
2 changed files with 10 additions and 5 deletions

View File

@@ -753,10 +753,9 @@ class InterfaceFilter(django_filters.FilterSet):
lookup_expr='isnull',
exclude=True
)
class_ = django_filters.CharFilter(
field_name='class',
method='filter_type',
label='Interface type',
kind = django_filters.CharFilter(
method='filter_kind',
label='Kind of interface',
)
lag_id = django_filters.ModelMultipleChoiceFilter(
field_name='lag',
@@ -819,7 +818,7 @@ class InterfaceFilter(django_filters.FilterSet):
Q(tagged_vlans__vid=value)
)
def filter_type(self, queryset, name, value):
def filter_kind(self, queryset, name, value):
value = value.strip().lower()
return {
'physical': queryset.exclude(type__in=NONCONNECTABLE_IFACE_TYPES),