Created
August 25, 2020 05:55
-
-
Save velotiotech/59196c2b39096272e105281dfafbb1c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthorSerializer(serializers.ModelSerializer): | |
class Meta: | |
model = Author | |
fields = "__all__" | |
class BookSerializer(serializers.ModelSerializer): | |
author = AuthorSerializer() | |
class Meta: | |
model = Book | |
fields = "__all__" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment