Skip to content

Instantly share code, notes, and snippets.

@kevin-brown
Created May 24, 2014 14:33
Show Gist options
  • Save kevin-brown/9e2d4579cd231f67a2da to your computer and use it in GitHub Desktop.
Save kevin-brown/9e2d4579cd231f67a2da to your computer and use it in GitHub Desktop.
Fixed DisablePaginationMixin. This needs to be added to your views.
class DisablePaginationMixin(object):
def get_paginate_by(self, queryset=None):
if self.paginate_by_param in self.request.QUERY_PARAMS and \
self.request.QUERY_PARAMS[self.paginate_by_param] == '0':
return None
return super(DisablePaginationMixin, self).get_paginate_by(queryset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment