mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-15 19:52:52 -06:00
dcim: filter group by site in rack filter (fixes #3229)
This commit is contained in:
parent
473dafc2c8
commit
e89343e100
@ -601,12 +601,18 @@ class RackFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm):
|
|||||||
widget=APISelectMultiple(
|
widget=APISelectMultiple(
|
||||||
api_url="/api/dcim/sites/",
|
api_url="/api/dcim/sites/",
|
||||||
value_field="slug",
|
value_field="slug",
|
||||||
|
filter_for={
|
||||||
|
'group_id': 'site'
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
group_id = FilterChoiceField(
|
|
||||||
queryset=RackGroup.objects.select_related('site'),
|
group_id = ChainedModelChoiceField(
|
||||||
label='Rack group',
|
label='Rack group',
|
||||||
null_label='-- None --',
|
queryset=RackGroup.objects.select_related('site'),
|
||||||
|
chains=(
|
||||||
|
('site', 'site'),
|
||||||
|
),
|
||||||
widget=APISelectMultiple(
|
widget=APISelectMultiple(
|
||||||
api_url="/api/dcim/rack-groups/",
|
api_url="/api/dcim/rack-groups/",
|
||||||
null_option=True,
|
null_option=True,
|
||||||
|
Loading…
Reference in New Issue
Block a user