Created
May 7, 2019 10:45
-
-
Save akshar-raaj/9ca774cb7c6eb511acec8289b7032f13 to your computer and use it in GitHub Desktop.
Question with choice_set serializer
This file contains hidden or 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 QuestionSerializer(serializers.ModelSerializer): | |
| choice_set = serializers.SlugRelatedField(slug_field='choice_text', 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