The field 'choice_set' was declared on serializer QuestionDetailPageSerializer, but has not been included in the 'fields' option. #8724
Unanswered
michaeloliveraz
asked this question in
Question & Answer
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Adding DRF to Polls from the DJango Tutorial. Created 'api' app and populated the views.py, urls.py and serializers.py
That was working fine on just Questions, but now I want to add Questions and Choices to the API.
I added this serializer class.
`class QuestionDetailPageSerializer(QuestionListPageSerializer):
choice_set = QuestionChoiceSerializer(many=True)
Now /swagger-docs throws this error.
AssertionError: The field 'choice_set' was declared on serializer QuestionDetailPageSerializer, but has not been included in the 'fields' option.
I tried adding , 'choice_set' to fields or Question and Choice serializers to no avail. What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions