Created
May 7, 2019 10:43
-
-
Save akshar-raaj/fc45b67c77e8de9141b2cd61fa66d8b3 to your computer and use it in GitHub Desktop.
Question with choices
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): | |
| class Meta: | |
| model = Question | |
| fields = ['id', 'pub_date', 'question_text', 'choice_set'] | |
| extra_kwargs = { | |
| 'choice_set': {'read_only': True} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment