mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-21 19:18:44 -06:00
* Use primary serializers for brief mode * Remove BriefModeMixin * Correct ModuleBayTest brief_fields (see #15243)
This commit is contained in:
@@ -27,6 +27,7 @@ class TenantGroupSerializer(NestedGroupModelSerializer):
|
||||
'id', 'url', 'display', 'name', 'slug', 'parent', 'description', 'tags', 'custom_fields', 'created',
|
||||
'last_updated', 'tenant_count', '_depth',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'tenant_count', '_depth')
|
||||
|
||||
|
||||
class TenantSerializer(NetBoxModelSerializer):
|
||||
@@ -52,6 +53,7 @@ class TenantSerializer(NetBoxModelSerializer):
|
||||
'created', 'last_updated', 'circuit_count', 'device_count', 'ipaddress_count', 'prefix_count', 'rack_count',
|
||||
'site_count', 'virtualmachine_count', 'vlan_count', 'vrf_count', 'cluster_count',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'slug')
|
||||
|
||||
|
||||
#
|
||||
@@ -69,6 +71,7 @@ class ContactGroupSerializer(NestedGroupModelSerializer):
|
||||
'id', 'url', 'display', 'name', 'slug', 'parent', 'description', 'tags', 'custom_fields', 'created',
|
||||
'last_updated', 'contact_count', '_depth',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'contact_count', '_depth')
|
||||
|
||||
|
||||
class ContactRoleSerializer(NetBoxModelSerializer):
|
||||
@@ -79,6 +82,7 @@ class ContactRoleSerializer(NetBoxModelSerializer):
|
||||
fields = [
|
||||
'id', 'url', 'display', 'name', 'slug', 'description', 'tags', 'custom_fields', 'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name', 'slug')
|
||||
|
||||
|
||||
class ContactSerializer(NetBoxModelSerializer):
|
||||
@@ -91,6 +95,7 @@ class ContactSerializer(NetBoxModelSerializer):
|
||||
'id', 'url', 'display', 'group', 'name', 'title', 'phone', 'email', 'address', 'link', 'description',
|
||||
'comments', 'tags', 'custom_fields', 'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'name')
|
||||
|
||||
|
||||
class ContactAssignmentSerializer(NetBoxModelSerializer):
|
||||
@@ -109,6 +114,7 @@ class ContactAssignmentSerializer(NetBoxModelSerializer):
|
||||
'id', 'url', 'display', 'content_type', 'object_id', 'object', 'contact', 'role', 'priority', 'tags',
|
||||
'custom_fields', 'created', 'last_updated',
|
||||
]
|
||||
brief_fields = ('id', 'url', 'display', 'contact', 'role', 'priority')
|
||||
|
||||
@extend_schema_field(OpenApiTypes.OBJECT)
|
||||
def get_object(self, instance):
|
||||
|
||||
Reference in New Issue
Block a user