Skip to content

Instantly share code, notes, and snippets.

@akshar-raaj
Created May 7, 2019 10:54
Show Gist options
  • Select an option

  • Save akshar-raaj/d849cca8bcc5a2e09ab126ea759dcae3 to your computer and use it in GitHub Desktop.

Select an option

Save akshar-raaj/d849cca8bcc5a2e09ab126ea759dcae3 to your computer and use it in GitHub Desktop.
QuestionSerializer using ChoiceSerializer
class QuestionSerializer(serializers.ModelSerializer):
choices = ChoiceSerializer(read_only=True, many=True)
class Meta:
model = Question
fields = '__all__'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment