1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #2578: Reorganized nested serializers

This commit is contained in:
Jeremy Stretch
2018-11-12 11:36:44 -05:00
parent 04ae6ec7af
commit 75f0d8ee90
18 changed files with 788 additions and 801 deletions

View File

@@ -0,0 +1,16 @@
from rest_framework import serializers
from secrets.models import SecretRole
from utilities.api import WritableNestedSerializer
__all__ = [
'NestedSecretRoleSerializer'
]
class NestedSecretRoleSerializer(WritableNestedSerializer):
url = serializers.HyperlinkedIdentityField(view_name='secrets-api:secretrole-detail')
class Meta:
model = SecretRole
fields = ['id', 'url', 'name', 'slug']