mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-18 13:06:30 -06:00
#8580 changes from code review
This commit is contained in:
parent
b4877e7fac
commit
d51e833bf3
@ -1144,6 +1144,9 @@ class CabledObjectFilterSet(django_filters.FilterSet):
|
|||||||
lookup_expr='isnull',
|
lookup_expr='isnull',
|
||||||
exclude=True
|
exclude=True
|
||||||
)
|
)
|
||||||
|
is_occupied = django_filters.BooleanFilter(
|
||||||
|
method='filter_is_occupied'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class PathEndpointFilterSet(django_filters.FilterSet):
|
class PathEndpointFilterSet(django_filters.FilterSet):
|
||||||
@ -1304,9 +1307,6 @@ class InterfaceFilterSet(
|
|||||||
to_field_name='rd',
|
to_field_name='rd',
|
||||||
label='VRF (RD)',
|
label='VRF (RD)',
|
||||||
)
|
)
|
||||||
is_occupied = django_filters.BooleanFilter(
|
|
||||||
method='filter_is_occupied'
|
|
||||||
)
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Interface
|
model = Interface
|
||||||
|
@ -1000,7 +1000,28 @@ class PowerOutletFilterForm(DeviceComponentFilterForm):
|
|||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
|
||||||
class InterfaceFilterForm(DeviceComponentFilterForm):
|
class CabledFilterForm(forms.Form):
|
||||||
|
cabled = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
widget=StaticSelect(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
connected = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
widget=StaticSelect(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
is_occupied = forms.NullBooleanField(
|
||||||
|
required=False,
|
||||||
|
widget=StaticSelect(
|
||||||
|
choices=BOOLEAN_WITH_BLANK_CHOICES
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class InterfaceFilterForm(CabledFilterForm, DeviceComponentFilterForm):
|
||||||
model = Interface
|
model = Interface
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(None, ('q', 'tag')),
|
(None, ('q', 'tag')),
|
||||||
@ -1088,24 +1109,6 @@ class InterfaceFilterForm(DeviceComponentFilterForm):
|
|||||||
label='VRF'
|
label='VRF'
|
||||||
)
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
cabled = forms.NullBooleanField(
|
|
||||||
required=False,
|
|
||||||
widget=StaticSelect(
|
|
||||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
||||||
)
|
|
||||||
)
|
|
||||||
connected = forms.NullBooleanField(
|
|
||||||
required=False,
|
|
||||||
widget=StaticSelect(
|
|
||||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
||||||
)
|
|
||||||
)
|
|
||||||
is_occupied = forms.NullBooleanField(
|
|
||||||
required=False,
|
|
||||||
widget=StaticSelect(
|
|
||||||
choices=BOOLEAN_WITH_BLANK_CHOICES
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class FrontPortFilterForm(DeviceComponentFilterForm):
|
class FrontPortFilterForm(DeviceComponentFilterForm):
|
||||||
|
Loading…
Reference in New Issue
Block a user