Skip to content

Commit

Permalink
16117 - Allow filtering by VLAN in Prefixes (#16204)
Browse files Browse the repository at this point in the history
* Updated clean method on DynamicModelMultipleChoiceField to return the name.

* Updated VLAN section name
  • Loading branch information
Julio-Oliveira-Encora authored May 21, 2024
1 parent b0520b9 commit ade6d2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions netbox/ipam/forms/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class PrefixFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
'within_include', 'family', 'status', 'role_id', 'mask_length', 'is_pool', 'mark_utilized',
name=_('Addressing')
),
FieldSet('vlan_id', name=_('VLAN Assignment')),
FieldSet('vrf_id', 'present_in_vrf_id', name=_('VRF')),
FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')),
FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')),
Expand Down Expand Up @@ -249,6 +250,12 @@ class PrefixFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm):
choices=BOOLEAN_WITH_BLANK_CHOICES
)
)
vlan_id = DynamicModelMultipleChoiceField(
queryset=VLAN.objects.all(),
required=False,
label=_('VLAN'),
)

tag = TagFilterField(model)


Expand Down

0 comments on commit ade6d2e

Please sign in to comment.