Created
May 7, 2019 11:10
-
-
Save akshar-raaj/d04e058aa8f35da9660d1cfe76c643ff to your computer and use it in GitHub Desktop.
ChoiceSerializerWithVotes and QuestionResultPageSerializer
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 ChoiceSerializerWithVotes(ChoiceSerializer): | |
| class Meta(ChoiceSerializer.Meta): | |
| fields = ChoiceSerializer.Meta.fields + ('votes',) | |
| class QuestionResultPageSerializer(QuestionListPageSerializer): | |
| choices = ChoiceSerializerWithVotes(many=True, read_only=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment