Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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