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

Added child counts to API serializers (WIP)

This commit is contained in:
Jeremy Stretch
2019-04-12 17:07:56 -04:00
parent b1c160f9d4
commit a46b43bff6
26 changed files with 206 additions and 94 deletions

View File

@ -10,7 +10,8 @@ __all__ = [
class NestedSecretRoleSerializer(WritableNestedSerializer):
url = serializers.HyperlinkedIdentityField(view_name='secrets-api:secretrole-detail')
secret_count = serializers.IntegerField(read_only=True)
class Meta:
model = SecretRole
fields = ['id', 'url', 'name', 'slug']
fields = ['id', 'url', 'name', 'slug', 'secret_count']