mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #4100: Added device field to device components filter forms
This commit is contained in:
parent
2296cdc222
commit
bb9e1ad857
@ -84,7 +84,18 @@ class DeviceComponentFilterForm(BootstrapMixin, forms.Form):
|
||||
to_field_name='slug',
|
||||
widget=APISelectMultiple(
|
||||
api_url="/api/dcim/sites/",
|
||||
value_field="slug"
|
||||
value_field="slug",
|
||||
filter_for={
|
||||
'device_id': 'site',
|
||||
}
|
||||
)
|
||||
)
|
||||
device_id = FilterChoiceField(
|
||||
queryset=Device.objects.all(),
|
||||
required=False,
|
||||
label='Device',
|
||||
widget=APISelectMultiple(
|
||||
api_url='/api/dcim/devices/',
|
||||
)
|
||||
)
|
||||
|
||||
@ -3642,6 +3653,7 @@ class CableFilterForm(BootstrapMixin, forms.Form):
|
||||
value_field="slug",
|
||||
filter_for={
|
||||
'rack_id': 'site',
|
||||
'device_id': 'site',
|
||||
}
|
||||
)
|
||||
)
|
||||
@ -3663,6 +3675,9 @@ class CableFilterForm(BootstrapMixin, forms.Form):
|
||||
widget=APISelectMultiple(
|
||||
api_url="/api/dcim/racks/",
|
||||
null_option=True,
|
||||
filter_for={
|
||||
'device_id': 'rack_id',
|
||||
}
|
||||
)
|
||||
)
|
||||
type = forms.MultipleChoiceField(
|
||||
@ -3816,6 +3831,9 @@ class ConsoleConnectionFilterForm(BootstrapMixin, forms.Form):
|
||||
widget=APISelectMultiple(
|
||||
api_url="/api/dcim/sites/",
|
||||
value_field="slug",
|
||||
filter_for={
|
||||
'device_id': 'site',
|
||||
}
|
||||
)
|
||||
)
|
||||
device_id = FilterChoiceField(
|
||||
@ -3835,6 +3853,9 @@ class PowerConnectionFilterForm(BootstrapMixin, forms.Form):
|
||||
widget=APISelectMultiple(
|
||||
api_url="/api/dcim/sites/",
|
||||
value_field="slug",
|
||||
filter_for={
|
||||
'device_id': 'site',
|
||||
}
|
||||
)
|
||||
)
|
||||
device_id = FilterChoiceField(
|
||||
@ -3854,6 +3875,9 @@ class InterfaceConnectionFilterForm(BootstrapMixin, forms.Form):
|
||||
widget=APISelectMultiple(
|
||||
api_url="/api/dcim/sites/",
|
||||
value_field="slug",
|
||||
filter_for={
|
||||
'device_id': 'site',
|
||||
}
|
||||
)
|
||||
)
|
||||
device_id = FilterChoiceField(
|
||||
|
Loading…
Reference in New Issue
Block a user