From 78c54054815e210a25748ef4e3b34268d941fa38 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Tue, 15 Apr 2025 20:36:41 +0200 Subject: [PATCH] feat(dcim): Add VLAN Translation Policy to Filter Form Introduces support for VLAN Translation Policies in the Interface Filter Form. --- netbox/dcim/forms/filtersets.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/netbox/dcim/forms/filtersets.py b/netbox/dcim/forms/filtersets.py index 8328f502f..41d426e86 100644 --- a/netbox/dcim/forms/filtersets.py +++ b/netbox/dcim/forms/filtersets.py @@ -6,7 +6,7 @@ from dcim.constants import * from dcim.models import * from extras.forms import LocalConfigContextFilterForm from extras.models import ConfigTemplate -from ipam.models import ASN, VRF +from ipam.models import ASN, VRF, VLANTranslationPolicy from netbox.choices import * from netbox.forms import NetBoxModelFilterSetForm from tenancy.forms import ContactModelFilterForm, TenancyFilterForm @@ -1332,7 +1332,7 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm): FieldSet('name', 'label', 'kind', 'type', 'speed', 'duplex', 'enabled', 'mgmt_only', name=_('Attributes')), FieldSet('vrf_id', 'l2vpn_id', 'mac_address', 'wwn', name=_('Addressing')), FieldSet('poe_mode', 'poe_type', name=_('PoE')), - FieldSet('mode', name=_('802.1Q Switching')), + FieldSet('mode', 'vlan_translation_policy_id', name=_('802.1Q Switching')), FieldSet('rf_role', 'rf_channel', 'rf_channel_width', 'tx_power', name=_('Wireless')), FieldSet('region_id', 'site_group_id', 'site_id', 'location_id', 'rack_id', name=_('Location')), FieldSet( @@ -1409,6 +1409,11 @@ class InterfaceFilterForm(PathEndpointFilterForm, DeviceComponentFilterForm): required=False, label=_('802.1Q mode') ) + vlan_translation_policy_id = DynamicModelMultipleChoiceField( + queryset=VLANTranslationPolicy.objects.all(), + required=False, + label=_('VLAN Translation Policy') + ) rf_role = forms.MultipleChoiceField( choices=WirelessRoleChoices, required=False,