mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-07 16:18:16 -06:00
Add site and site_id back
This commit is contained in:
parent
704f6fbefb
commit
d5ee16c089
@ -519,7 +519,8 @@ class PowerOutletFilter(DeviceComponentFilterSet):
|
||||
|
||||
class InterfaceFilter(django_filters.FilterSet):
|
||||
"""
|
||||
|
||||
Not using DeviceComponentFilterSet for Interfaces because we need to glean the ordering logic from the parent
|
||||
Device's DeviceType.
|
||||
"""
|
||||
device = django_filters.CharFilter(
|
||||
method='filter_device',
|
||||
@ -581,6 +582,16 @@ class InterfaceListFilter(django_filters.FilterSet):
|
||||
method='search',
|
||||
label='Search',
|
||||
)
|
||||
site_id = django_filters.ModelMultipleChoiceFilter(
|
||||
queryset=Site.objects.all(),
|
||||
label='Site (ID)',
|
||||
)
|
||||
site = django_filters.ModelMultipleChoiceFilter(
|
||||
name='site__slug',
|
||||
queryset=Site.objects.all(),
|
||||
to_field_name='slug',
|
||||
label='Site name (slug)',
|
||||
)
|
||||
#site_id = django_filters.ModelMultipleChoiceFilter(
|
||||
# queryset=Device.objects.select_related('site'),
|
||||
# label='Site (ID)',
|
||||
|
Loading…
Reference in New Issue
Block a user