Skip to content

Commit 9d62174

Browse files
Luke Andersonjeremystretch
Luke Anderson
authored andcommitted
Fix #12245 - Add WLAN to InterfaceBulkEditForm
1 parent a96b76a commit 9d62174

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

netbox/dcim/forms/bulk_edit.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from utilities.forms import BulkEditForm, add_blank_choice, form_from_model
1414
from utilities.forms.fields import ColorField, CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField
1515
from utilities.forms.widgets import BulkEditNullBooleanSelect, NumberWithOptions
16+
from wireless.models import WirelessLAN, WirelessLANGroup
1617

1718
__all__ = (
1819
'CableBulkEditForm',
@@ -1139,7 +1140,7 @@ class InterfaceBulkEditForm(
11391140
form_from_model(Interface, [
11401141
'label', 'type', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'mtu', 'mgmt_only',
11411142
'mark_connected', 'description', 'mode', 'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width',
1142-
'tx_power',
1143+
'tx_power', 'wireless_lans'
11431144
]),
11441145
ComponentBulkEditForm
11451146
):
@@ -1229,6 +1230,19 @@ class InterfaceBulkEditForm(
12291230
required=False,
12301231
label=_('VRF')
12311232
)
1233+
wireless_lan_group = DynamicModelChoiceField(
1234+
queryset=WirelessLANGroup.objects.all(),
1235+
required=False,
1236+
label=_('Wireless LAN group')
1237+
)
1238+
wireless_lans = DynamicModelMultipleChoiceField(
1239+
queryset=WirelessLAN.objects.all(),
1240+
required=False,
1241+
label=_('Wireless LANs'),
1242+
query_params={
1243+
'group_id': '$wireless_lan_group',
1244+
}
1245+
)
12321246

12331247
model = Interface
12341248
fieldsets = (
@@ -1238,12 +1252,14 @@ class InterfaceBulkEditForm(
12381252
('PoE', ('poe_mode', 'poe_type')),
12391253
('Related Interfaces', ('parent', 'bridge', 'lag')),
12401254
('802.1Q Switching', ('mode', 'vlan_group', 'untagged_vlan', 'tagged_vlans')),
1241-
('Wireless', ('rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width')),
1255+
('Wireless', (
1256+
'rf_role', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'wireless_lan_group', 'wireless_lans',
1257+
)),
12421258
)
12431259
nullable_fields = (
12441260
'module', 'label', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'vdcs', 'mtu', 'description',
12451261
'poe_mode', 'poe_type', 'mode', 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power',
1246-
'vlan_group', 'untagged_vlan', 'tagged_vlans', 'vrf',
1262+
'vlan_group', 'untagged_vlan', 'tagged_vlans', 'vrf', 'wireless_lans'
12471263
)
12481264

12491265
def __init__(self, *args, **kwargs):

0 commit comments

Comments
 (0)