def get_pagination_serializer(self, page):
        class SerializerClass(self.pagination_serializer_class):
            class Meta:
                object_serializer_class = AnswerSerializer

        context = self.get_serializer_context()
        return SerializerClass(instance=page, context=context)
Return a serializer instance to use with paginated data.
dataset/ETHPy150Open mozilla/kitsune/kitsune/questions/api.py/AnswerViewSet.get_pagination_serializer