pass many=False to pagination_serializer_class()

pagination serializers should always have many=False set, otherwise they'll
be passed the individual objects of the page rather than the page object
itself. this is a real/better fix for #1186. removes the need for the
deprecated isinstance Page check, though it's left in place since it
doesn't hurt anything.
This commit is contained in:
Ross McFarland 2013-10-22 07:35:21 -07:00
parent f92d8bd972
commit d61f541d35

View File

@ -111,7 +111,8 @@ class GenericAPIView(views.APIView):
pagination_serializer_class = SerializerClass
context = self.get_serializer_context()
return pagination_serializer_class(instance=page, context=context)
return pagination_serializer_class(instance=page, context=context,
many=False)
def paginate_queryset(self, queryset, page_size=None):
"""