mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add 'display' field to all REST API serializers
This commit is contained in:
@@ -20,7 +20,7 @@ class NestedTenantGroupSerializer(WritableNestedSerializer):
|
||||
|
||||
class Meta:
|
||||
model = TenantGroup
|
||||
fields = ['id', 'url', 'name', 'slug', 'tenant_count', '_depth']
|
||||
fields = ['id', 'url', 'display', 'name', 'slug', 'tenant_count', '_depth']
|
||||
|
||||
|
||||
class NestedTenantSerializer(WritableNestedSerializer):
|
||||
@@ -28,4 +28,4 @@ class NestedTenantSerializer(WritableNestedSerializer):
|
||||
|
||||
class Meta:
|
||||
model = Tenant
|
||||
fields = ['id', 'url', 'name', 'slug']
|
||||
fields = ['id', 'url', 'display', 'name', 'slug']
|
||||
|
||||
@@ -17,7 +17,7 @@ class TenantGroupSerializer(NestedGroupModelSerializer):
|
||||
class Meta:
|
||||
model = TenantGroup
|
||||
fields = [
|
||||
'id', 'url', 'name', 'slug', 'parent', 'description', 'custom_fields', 'created', 'last_updated',
|
||||
'id', 'url', 'display', 'name', 'slug', 'parent', 'description', 'custom_fields', 'created', 'last_updated',
|
||||
'tenant_count', '_depth',
|
||||
]
|
||||
|
||||
@@ -39,7 +39,7 @@ class TenantSerializer(PrimaryModelSerializer):
|
||||
class Meta:
|
||||
model = Tenant
|
||||
fields = [
|
||||
'id', 'url', 'name', 'slug', 'group', 'description', 'comments', 'tags', 'custom_fields', 'created',
|
||||
'last_updated', 'circuit_count', 'device_count', 'ipaddress_count', 'prefix_count', 'rack_count',
|
||||
'id', 'url', 'display', 'name', 'slug', 'group', 'description', 'comments', 'tags', 'custom_fields',
|
||||
'created', 'last_updated', 'circuit_count', 'device_count', 'ipaddress_count', 'prefix_count', 'rack_count',
|
||||
'site_count', 'virtualmachine_count', 'vlan_count', 'vrf_count', 'cluster_count',
|
||||
]
|
||||
|
||||
@@ -16,7 +16,7 @@ class AppTest(APITestCase):
|
||||
|
||||
class TenantGroupTest(APIViewTestCases.APIViewTestCase):
|
||||
model = TenantGroup
|
||||
brief_fields = ['_depth', 'id', 'name', 'slug', 'tenant_count', 'url']
|
||||
brief_fields = ['_depth', 'display', 'id', 'name', 'slug', 'tenant_count', 'url']
|
||||
bulk_update_data = {
|
||||
'description': 'New description',
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class TenantGroupTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class TenantTest(APIViewTestCases.APIViewTestCase):
|
||||
model = Tenant
|
||||
brief_fields = ['id', 'name', 'slug', 'url']
|
||||
brief_fields = ['display', 'id', 'name', 'slug', 'url']
|
||||
bulk_update_data = {
|
||||
'group': None,
|
||||
'description': 'New description',
|
||||
|
||||
Reference in New Issue
Block a user