Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get all ForeignKey data by nesting in django

class AccountSerializer(serializers.ModelSerializer):
    class Meta:
        model = Account
        fields = ['id', 'account_name', 'users', 'created']
        depth = 1
Source by www.django-rest-framework.org #
 
PREVIOUS NEXT
Tagged: #ForeignKey #data #nesting #django
ADD COMMENT
Topic
Name
7+6 =