Skip to content

Commit

Permalink
Fixed DRF 3.5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tuffnatty committed Oct 23, 2016
1 parent 47f9b30 commit 94258d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proxy_pagination/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from rest_framework.pagination import BasePagination
from rest_framework.settings import import_from_string

__version__ = '0.1.0'
__version__ = '0.1.1'


class ProxyPagination(BasePagination):
Expand All @@ -16,6 +16,9 @@ class ProxyPagination(BasePagination):
mapping = {alias: import_from_string(path, 'PROXY_PAGINATION_MAPPING')
for alias, path in settings.PROXY_PAGINATION_MAPPING.items()}

def __init__(self):
self.pager = self.default_pager()

def paginate_queryset(self, queryset, request, view=None):
alias = request.query_params.get(self.pager_query_param)
self.pager = self.mapping.get(alias, self.default_pager)()
Expand Down

0 comments on commit 94258d1

Please sign in to comment.