              serializer = self.get_serializer(self.object_list)
  
          return Response(serializer.data)
  
      def get_paginate_by(self, queryset):
          if self.page_size_kwarg is not None:
              page_size_kwarg = self.request.QUERY_PARAMS.get(self.page_size_kwarg)
              if page_size_kwarg:
                  try:
                      page_size = int(page_size_kwarg)
                      return page_size
                  except ValueError:
                      pass
          return super(ListModelMixin, self).get_paginate_by(queryset)
  
  
  class RetrieveModelMixin(object):
      """
      Retrieve a model instance.
      Should be mixed in with `SingleObjectBaseView`.
 
</s> remove     page_size_kwarg = api_settings.PAGE_SIZE_KWARG
 </s> add  </s> remove         return SerializerClass

    def get_pagination_serializer(self, page=None):
        pagination_serializer_class = self.get_pagination_serializer_class()
 </s> add         pagination_serializer_class = SerializerClass </s> remove 

class TestNonePageSizeKwarg(TestCase):
    """
    Tests for list views with default page size kwarg
    """

    def setUp(self):
        """
        Create 13 BasicModel instances.
        """
        for i in range(13):
            BasicModel(text=i).save()
        self.objects = BasicModel.objects
        self.data = [
        {'id': obj.id, 'text': obj.text}
        for obj in self.objects.all()
        ]
        self.view = NonePageSizeKwargView.as_view()

    def test_default_page_size(self):
        """
        Tests the default page size for this view.
        no page size --> no limit --> no meta data
        """
        request = factory.get('/')
        response = self.view(request).render()
        self.assertEquals(response.data, self.data)

    def test_none_page_size_kwarg(self):
        """
        If page_size_kwarg is set to None, custom page_size per request should be disabled.
        """
        request = factory.get('/?page_size=5')
        response = self.view(request).render()
        self.assertEquals(response.data, self.data)
 </s> add  </s> remove     def test_disabled_default_page_size_kwarg(self):
 </s> add     def test_paginate_by_param(self):
              serializer = self.get_serializer(self.object_list)
  
          return Response(serializer.data)
  











  
  class RetrieveModelMixin(object):
      """
      Retrieve a model instance.
      Should be mixed in with `SingleObjectBaseView`.
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Polishing to page size query parameters & more docs 
rest_framework/mixins.py