mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 03:50:11 +03:00
Allow setting the paginator serializer class to None #611
This commit is contained in:
parent
9e9233f87f
commit
9ee8ce575b
|
@ -92,6 +92,7 @@ class GenericAPIView(views.APIView):
|
|||
"""
|
||||
Return a serializer instance to use with paginated data.
|
||||
"""
|
||||
if self.pagination_serializer_class:
|
||||
class SerializerClass(self.pagination_serializer_class):
|
||||
class Meta:
|
||||
object_serializer_class = self.get_serializer_class()
|
||||
|
|
|
@ -90,7 +90,10 @@ class ListModelMixin(object):
|
|||
page = self.paginate_queryset(self.object_list)
|
||||
if page is not None:
|
||||
serializer = self.get_pagination_serializer(page)
|
||||
else:
|
||||
|
||||
if serializer:
|
||||
return Response(serializer.data)
|
||||
|
||||
serializer = self.get_serializer(self.object_list, many=True)
|
||||
|
||||
return Response(serializer.data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user