mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 11:56:25 -06:00
10711 review changes
This commit is contained in:
parent
610eb1b32e
commit
3f1b2e0acf
@ -96,6 +96,7 @@ class ScopedBulkEditForm(forms.Form):
|
||||
except ObjectDoesNotExist:
|
||||
pass
|
||||
|
||||
|
||||
class ScopedImportForm(forms.Form):
|
||||
scope_type = CSVContentTypeField(
|
||||
queryset=ContentType.objects.filter(model__in=LOCATION_SCOPE_TYPES),
|
||||
|
@ -1,8 +1,10 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from dcim.constants import LOCATION_SCOPE_TYPES
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from drf_spectacular.utils import extend_schema_field
|
||||
from ipam.api.serializers_.vlans import VLANSerializer
|
||||
from netbox.api.fields import ChoiceField
|
||||
from netbox.api.fields import ChoiceField, ContentTypeField
|
||||
from netbox.api.serializers import NestedGroupModelSerializer, NetBoxModelSerializer
|
||||
from tenancy.api.serializers_.tenants import TenantSerializer
|
||||
from utilities.api import get_serializer_for_model
|
||||
@ -36,6 +38,14 @@ class WirelessLANSerializer(NetBoxModelSerializer):
|
||||
tenant = TenantSerializer(nested=True, required=False, allow_null=True)
|
||||
auth_type = ChoiceField(choices=WirelessAuthTypeChoices, required=False, allow_blank=True)
|
||||
auth_cipher = ChoiceField(choices=WirelessAuthCipherChoices, required=False, allow_blank=True)
|
||||
scope_type = ContentTypeField(
|
||||
queryset=ContentType.objects.filter(
|
||||
model__in=LOCATION_SCOPE_TYPES
|
||||
),
|
||||
allow_null=True,
|
||||
required=False,
|
||||
default=None
|
||||
)
|
||||
scope_id = serializers.IntegerField(allow_null=True, required=False, default=None)
|
||||
scope = serializers.SerializerMethodField(read_only=True)
|
||||
|
||||
|
@ -80,7 +80,7 @@ class WirelessLANImportForm(ScopedImportForm, NetBoxModelImportForm):
|
||||
'description', 'comments', 'tags',
|
||||
)
|
||||
labels = {
|
||||
'scope_id': 'Scope ID',
|
||||
'scope_id': _('Scope ID'),
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,7 +71,6 @@ class WirelessLANForm(ScopedForm, TenancyForm, NetBoxModelForm):
|
||||
}
|
||||
|
||||
|
||||
|
||||
class WirelessLinkForm(TenancyForm, NetBoxModelForm):
|
||||
site_a = DynamicModelChoiceField(
|
||||
queryset=Site.objects.all(),
|
||||
|
Loading…
Reference in New Issue
Block a user