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

Closes #5641: Allow filtering device components by label

This commit is contained in:
Jeremy Stretch
2021-03-24 14:48:38 -04:00
parent ad2742dbb2
commit ab65ab860f
4 changed files with 92 additions and 46 deletions

View File

@ -60,12 +60,18 @@ def get_device_by_name_or_pk(name):
class DeviceComponentFilterForm(BootstrapMixin, forms.Form):
field_order = [
'q', 'region', 'site'
'q', 'name', 'label', 'region', 'site'
]
q = forms.CharField(
required=False,
label='Search'
)
name = forms.CharField(
required=False
)
label = forms.CharField(
required=False
)
region = DynamicModelMultipleChoiceField(
queryset=Region.objects.all(),
to_field_name='slug',