mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
33 lines
830 B
Python
33 lines
830 B
Python
![]() |
from dcim.constants import *
|
||
|
from dcim.models import *
|
||
|
from extras.forms import CustomFieldModelForm
|
||
|
from extras.models import Tag
|
||
|
from ipam.models import VLAN
|
||
|
from utilities.forms import BootstrapMixin, DynamicModelChoiceField, DynamicModelMultipleChoiceField
|
||
|
from wireless.models import SSID
|
||
|
|
||
|
__all__ = (
|
||
|
'SSIDForm',
|
||
|
)
|
||
|
|
||
|
|
||
|
class SSIDForm(BootstrapMixin, CustomFieldModelForm):
|
||
|
vlan = DynamicModelChoiceField(
|
||
|
queryset=VLAN.objects.all(),
|
||
|
required=False
|
||
|
)
|
||
|
tags = DynamicModelMultipleChoiceField(
|
||
|
queryset=Tag.objects.all(),
|
||
|
required=False
|
||
|
)
|
||
|
|
||
|
class Meta:
|
||
|
model = SSID
|
||
|
fields = [
|
||
|
'name', 'description', 'vlan', 'tags',
|
||
|
]
|
||
|
fieldsets = (
|
||
|
('SSID', ('name', 'description', 'tags')),
|
||
|
('VLAN', ('vlan',)),
|
||
|
)
|