mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
@ -1,3 +1,11 @@
|
|||||||
|
# v2.6.11 (FUTURE)
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
|
||||||
|
* [#3831](https://github.com/netbox-community/netbox/issues/3831) - Fix API-driven filter field rendering (#3812 regression)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# v2.6.10 (2020-01-02)
|
# v2.6.10 (2020-01-02)
|
||||||
|
|
||||||
## Enhancements
|
## Enhancements
|
||||||
|
@ -302,6 +302,9 @@ class CircuitFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm
|
|||||||
widget=APISelectMultiple(
|
widget=APISelectMultiple(
|
||||||
api_url="/api/dcim/regions/",
|
api_url="/api/dcim/regions/",
|
||||||
value_field="slug",
|
value_field="slug",
|
||||||
|
filter_for={
|
||||||
|
'site': 'region'
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
site = FilterChoiceField(
|
site = FilterChoiceField(
|
||||||
|
@ -651,16 +651,15 @@ class RackFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFilterForm):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
group_id = ChainedModelChoiceField(
|
group_id = FilterChoiceField(
|
||||||
label='Rack group',
|
queryset=RackGroup.objects.prefetch_related(
|
||||||
queryset=RackGroup.objects.prefetch_related('site'),
|
'site'
|
||||||
chains=(
|
|
||||||
('site', 'site'),
|
|
||||||
),
|
),
|
||||||
required=False,
|
label='Rack group',
|
||||||
|
null_label='-- None --',
|
||||||
widget=APISelectMultiple(
|
widget=APISelectMultiple(
|
||||||
api_url="/api/dcim/rack-groups/",
|
api_url="/api/dcim/rack-groups/",
|
||||||
null_option=True,
|
null_option=True
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
status = forms.MultipleChoiceField(
|
status = forms.MultipleChoiceField(
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
<select name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>{% for group_name, group_choices, group_index in widget.optgroups %}{% if group_name %}
|
<select name="{{ widget.name }}"{% include "django/forms/widgets/attrs.html" %}>
|
||||||
<optgroup label="{{ group_name }}">{% endif %}{% for widget in group_choices %}{% if widget.attrs.selected %}
|
{% for group_name, group_choices, group_index in widget.optgroups %}
|
||||||
{% include widget.template_name %}{% endif %}{% endfor %}{% if group_name %}
|
{% if group_name %}<optgroup label="{{ group_name }}">{% endif %}
|
||||||
</optgroup>{% endif %}{% endfor %}
|
{% for option in group_choices %}
|
||||||
|
{% if option.attrs.selected or option.value == "null" %}{% include option.template_name with widget=option %}{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% if group_name %}</optgroup>{% endif %}
|
||||||
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
@ -563,7 +563,9 @@ class VirtualMachineFilterForm(BootstrapMixin, TenancyFilterForm, CustomFieldFil
|
|||||||
widget=APISelectMultiple(
|
widget=APISelectMultiple(
|
||||||
api_url='/api/dcim/regions/',
|
api_url='/api/dcim/regions/',
|
||||||
value_field="slug",
|
value_field="slug",
|
||||||
null_option=True,
|
filter_for={
|
||||||
|
'site': 'region'
|
||||||
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
site = FilterChoiceField(
|
site = FilterChoiceField(
|
||||||
|
Reference in New Issue
Block a user