2021-10-13 09:46:17 -04:00
|
|
|
from dcim.models import Interface
|
2021-10-12 12:27:12 -04:00
|
|
|
from extras.forms import CustomFieldModelCSVForm
|
|
|
|
|
from ipam.models import VLAN
|
|
|
|
|
from utilities.forms import CSVModelChoiceField
|
2021-10-13 09:46:17 -04:00
|
|
|
from wireless.models import *
|
2021-10-12 12:27:12 -04:00
|
|
|
|
|
|
|
|
__all__ = (
|
2021-10-12 17:02:53 -04:00
|
|
|
'WirelessLANCSVForm',
|
2021-10-13 09:46:17 -04:00
|
|
|
'WirelessLinkCSVForm',
|
2021-10-12 12:27:12 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2021-10-12 17:02:53 -04:00
|
|
|
class WirelessLANCSVForm(CustomFieldModelCSVForm):
|
2021-10-12 12:27:12 -04:00
|
|
|
vlan = CSVModelChoiceField(
|
|
|
|
|
queryset=VLAN.objects.all(),
|
|
|
|
|
to_field_name='name',
|
|
|
|
|
help_text='Bridged VLAN'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
class Meta:
|
2021-10-12 17:02:53 -04:00
|
|
|
model = WirelessLAN
|
|
|
|
|
fields = ('ssid', 'description', 'vlan')
|
2021-10-13 09:46:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class WirelessLinkCSVForm(CustomFieldModelCSVForm):
|
|
|
|
|
interface_a = CSVModelChoiceField(
|
|
|
|
|
queryset=Interface.objects.all()
|
|
|
|
|
)
|
|
|
|
|
interface_b = CSVModelChoiceField(
|
|
|
|
|
queryset=Interface.objects.all()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
model = WirelessLink
|
|
|
|
|
fields = ('interface_a', 'interface_b', 'ssid', 'description')
|