0

我从这里尝试了 DjangoRestMultipleModels Pagination ,现在我面临 JSON 可序列化错误!

视图.py

from drf_multiple_model.views import ObjectMultipleModelAPIView
from drf_multiple_model.pagination import MultipleModelLimitOffsetPagination

class LimitPagination(MultipleModelLimitOffsetPagination):
    default_limit = 2


class MultiplePagination(ObjectMultipleModelAPIView):
    pagination_class = LimitPagination
    def get(self, request, *args, **kwargs):
        querylist = (
            {'queryset': Publisher.objects.all(), 'serializer_class': PublisherSerializer},
            {'queryset': Book.objects.all(), 'serializer_class': BookSerializer},
        )
        return Response(querylist, status=200)

这是我面临的错误......

这是错误。

4

0 回答 0