mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Closes #8244: Add length & length unit fields to cable filter form
This commit is contained in:
parent
aec2d233c9
commit
574c2e2770
@ -5,6 +5,7 @@
|
|||||||
### Enhancements
|
### Enhancements
|
||||||
|
|
||||||
* [#8231](https://github.com/netbox-community/netbox/issues/8231) - Use in-page dialogs for confirming object deletion
|
* [#8231](https://github.com/netbox-community/netbox/issues/8231) - Use in-page dialogs for confirming object deletion
|
||||||
|
* [#8244](https://github.com/netbox-community/netbox/issues/8244) - Add length & length unit fields to cable filter form
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
@ -578,7 +578,7 @@ class CableFilterForm(TenancyFilterForm, CustomFieldModelFilterForm):
|
|||||||
field_groups = [
|
field_groups = [
|
||||||
['q', 'tag'],
|
['q', 'tag'],
|
||||||
['site_id', 'rack_id', 'device_id'],
|
['site_id', 'rack_id', 'device_id'],
|
||||||
['type', 'status', 'color'],
|
['type', 'status', 'color', 'length', 'length_unit'],
|
||||||
['tenant_group_id', 'tenant_id'],
|
['tenant_group_id', 'tenant_id'],
|
||||||
]
|
]
|
||||||
region_id = DynamicModelMultipleChoiceField(
|
region_id = DynamicModelMultipleChoiceField(
|
||||||
@ -603,6 +603,16 @@ class CableFilterForm(TenancyFilterForm, CustomFieldModelFilterForm):
|
|||||||
'site_id': '$site_id'
|
'site_id': '$site_id'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
device_id = DynamicModelMultipleChoiceField(
|
||||||
|
queryset=Device.objects.all(),
|
||||||
|
required=False,
|
||||||
|
query_params={
|
||||||
|
'site_id': '$site_id',
|
||||||
|
'tenant_id': '$tenant_id',
|
||||||
|
'rack_id': '$rack_id',
|
||||||
|
},
|
||||||
|
label=_('Device')
|
||||||
|
)
|
||||||
type = forms.MultipleChoiceField(
|
type = forms.MultipleChoiceField(
|
||||||
choices=add_blank_choice(CableTypeChoices),
|
choices=add_blank_choice(CableTypeChoices),
|
||||||
required=False,
|
required=False,
|
||||||
@ -616,15 +626,12 @@ class CableFilterForm(TenancyFilterForm, CustomFieldModelFilterForm):
|
|||||||
color = ColorField(
|
color = ColorField(
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
device_id = DynamicModelMultipleChoiceField(
|
length = forms.IntegerField(
|
||||||
queryset=Device.objects.all(),
|
required=False
|
||||||
required=False,
|
)
|
||||||
query_params={
|
length_unit = forms.ChoiceField(
|
||||||
'site_id': '$site_id',
|
choices=add_blank_choice(CableLengthUnitChoices),
|
||||||
'tenant_id': '$tenant_id',
|
required=False
|
||||||
'rack_id': '$rack_id',
|
|
||||||
},
|
|
||||||
label=_('Device')
|
|
||||||
)
|
)
|
||||||
tag = TagFilterField(model)
|
tag = TagFilterField(model)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user