mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-24 20:39:59 -06:00
Closes #20304: Object owners (#20634)
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CI / build (20.x, 3.13) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CI / build (20.x, 3.13) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from drf_spectacular.utils import extend_schema_field
|
||||
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, ContentTypeField
|
||||
from netbox.api.serializers import NestedGroupModelSerializer, NetBoxModelSerializer
|
||||
from netbox.api.serializers import NestedGroupModelSerializer, PrimaryModelSerializer
|
||||
from tenancy.api.serializers_.tenants import TenantSerializer
|
||||
from utilities.api import get_serializer_for_model
|
||||
from wireless.choices import *
|
||||
@@ -26,12 +26,12 @@ class WirelessLANGroupSerializer(NestedGroupModelSerializer):
|
||||
model = WirelessLANGroup
|
||||
fields = [
|
||||
'id', 'url', 'display_url', 'display', 'name', 'slug', 'parent', 'description', 'tags', 'custom_fields',
|
||||
'created', 'last_updated', 'wirelesslan_count', 'comments', '_depth',
|
||||
'created', 'last_updated', 'wirelesslan_count', 'owner', 'comments', '_depth',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'description', 'wirelesslan_count', '_depth')
|
||||
|
||||
|
||||
class WirelessLANSerializer(NetBoxModelSerializer):
|
||||
class WirelessLANSerializer(PrimaryModelSerializer):
|
||||
group = WirelessLANGroupSerializer(nested=True, required=False, allow_null=True)
|
||||
status = ChoiceField(choices=WirelessLANStatusChoices, required=False, allow_blank=True)
|
||||
vlan = VLANSerializer(nested=True, required=False, allow_null=True)
|
||||
@@ -53,8 +53,8 @@ class WirelessLANSerializer(NetBoxModelSerializer):
|
||||
model = WirelessLAN
|
||||
fields = [
|
||||
'id', 'url', 'display_url', 'display', 'ssid', 'description', 'group', 'status', 'vlan', 'scope_type',
|
||||
'scope_id', 'scope', 'tenant', 'auth_type', 'auth_cipher', 'auth_psk', 'description', 'comments', 'tags',
|
||||
'custom_fields', 'created', 'last_updated',
|
||||
'scope_id', 'scope', 'tenant', 'auth_type', 'auth_cipher', 'auth_psk', 'description', 'owner', 'comments',
|
||||
'tags', 'custom_fields', 'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'ssid', 'description')
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from dcim.api.serializers_.device_components import InterfaceSerializer
|
||||
from dcim.choices import LinkStatusChoices
|
||||
from netbox.api.fields import ChoiceField
|
||||
from netbox.api.serializers import NetBoxModelSerializer
|
||||
from netbox.api.serializers import PrimaryModelSerializer
|
||||
from netbox.choices import *
|
||||
from tenancy.api.serializers_.tenants import TenantSerializer
|
||||
from wireless.choices import *
|
||||
@@ -12,7 +12,7 @@ __all__ = (
|
||||
)
|
||||
|
||||
|
||||
class WirelessLinkSerializer(NetBoxModelSerializer):
|
||||
class WirelessLinkSerializer(PrimaryModelSerializer):
|
||||
status = ChoiceField(choices=LinkStatusChoices, required=False)
|
||||
interface_a = InterfaceSerializer(nested=True)
|
||||
interface_b = InterfaceSerializer(nested=True)
|
||||
@@ -25,7 +25,7 @@ class WirelessLinkSerializer(NetBoxModelSerializer):
|
||||
model = WirelessLink
|
||||
fields = [
|
||||
'id', 'url', 'display_url', 'display', 'interface_a', 'interface_b', 'ssid', 'status', 'tenant',
|
||||
'auth_type', 'auth_cipher', 'auth_psk', 'distance', 'distance_unit', 'description',
|
||||
'comments', 'tags', 'custom_fields', 'created', 'last_updated',
|
||||
'auth_type', 'auth_cipher', 'auth_psk', 'distance', 'distance_unit', 'description', 'owner', 'comments',
|
||||
'tags', 'custom_fields', 'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'ssid', 'description')
|
||||
|
||||
Reference in New Issue
Block a user