'ListSerializer' object is not callable

前端 未结 1 1533
被撕碎了的回忆
被撕碎了的回忆 2021-01-04 18:25

I am trying to implement Django-Rest framework for a voting application with content_type objects. I tried using the rest-framework-generic-relations for serializers.py. I

相关标签:
1条回答
  • 2021-01-04 19:12

    The error is that it's trying to call the serializer_class, which is an instance of ListSerializer, instead of a clas.

    Shouldn't this:

    serializer_class = VoteSerializer(queryset, many=True)
    

    Be that:

    serializer_class = VoteSerializer
    
    0 讨论(0)
提交回复
热议问题