mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 21:02:23 -06:00
Add WirelessLANGroup model
This commit is contained in:
@@ -2,16 +2,37 @@ from dcim.choices import LinkStatusChoices
|
||||
from dcim.models import Interface
|
||||
from extras.forms import CustomFieldModelCSVForm
|
||||
from ipam.models import VLAN
|
||||
from utilities.forms import CSVChoiceField, CSVModelChoiceField
|
||||
from utilities.forms import CSVChoiceField, CSVModelChoiceField, SlugField
|
||||
from wireless.models import *
|
||||
|
||||
__all__ = (
|
||||
'WirelessLANCSVForm',
|
||||
'WirelessLANGroupCSVForm',
|
||||
'WirelessLinkCSVForm',
|
||||
)
|
||||
|
||||
|
||||
class WirelessLANGroupCSVForm(CustomFieldModelCSVForm):
|
||||
parent = CSVModelChoiceField(
|
||||
queryset=WirelessLANGroup.objects.all(),
|
||||
required=False,
|
||||
to_field_name='name',
|
||||
help_text='Parent group'
|
||||
)
|
||||
slug = SlugField()
|
||||
|
||||
class Meta:
|
||||
model = WirelessLANGroup
|
||||
fields = ('name', 'slug', 'parent', 'description')
|
||||
|
||||
|
||||
class WirelessLANCSVForm(CustomFieldModelCSVForm):
|
||||
group = CSVModelChoiceField(
|
||||
queryset=WirelessLANGroup.objects.all(),
|
||||
required=False,
|
||||
to_field_name='name',
|
||||
help_text='Assigned group'
|
||||
)
|
||||
vlan = CSVModelChoiceField(
|
||||
queryset=VLAN.objects.all(),
|
||||
to_field_name='name',
|
||||
@@ -20,7 +41,7 @@ class WirelessLANCSVForm(CustomFieldModelCSVForm):
|
||||
|
||||
class Meta:
|
||||
model = WirelessLAN
|
||||
fields = ('ssid', 'description', 'vlan')
|
||||
fields = ('ssid', 'group', 'description', 'vlan')
|
||||
|
||||
|
||||
class WirelessLinkCSVForm(CustomFieldModelCSVForm):
|
||||
|
||||
Reference in New Issue
Block a user