Add WirelessLANGroup model

This commit is contained in:
jeremystretch
2021-10-13 16:40:12 -04:00
parent d6202027d1
commit 3915a96d07
19 changed files with 429 additions and 16 deletions

View File

@@ -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):