From: jtauber Date: Wed, 18 Jun 2008 09:48:32 +0000 (+0000) Subject: paging maintains other GET parameters -- contributed by jezdez X-Git-Tag: 1.0.6~43 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/dcbff8649c4835a64975d28161a1cebb278180ea?ds=sidebyside;hp=a35ff9bd925bb5fd3ab2e43cae19a62afb2f5701 paging maintains other GET parameters -- contributed by jezdez git-svn-id: https://django-pagination.googlecode.com/svn/trunk@14 7f1efe38-554e-0410-b69d-834cb44da2d5 --- diff --git a/pagination/templates/pagination/pagination.html b/pagination/templates/pagination/pagination.html index 8abee2d..3799314 100644 --- a/pagination/templates/pagination/pagination.html +++ b/pagination/templates/pagination/pagination.html @@ -1,8 +1,25 @@ {% if is_paginated %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/pagination/templatetags/pagination_tags.py b/pagination/templatetags/pagination_tags.py index e688b05..6db06ba 100644 --- a/pagination/templatetags/pagination_tags.py +++ b/pagination/templatetags/pagination_tags.py @@ -114,11 +114,16 @@ def paginate(context, window=4): pages.extend(second_list) else: pages.extend(sorted(list(last.difference(current)))) - return { + + getvars = context['request'].GET.copy() + if 'page' in getvars: + del getvars['page'] + return { 'pages': pages, 'page_obj': page_obj, 'paginator': paginator, 'is_paginated': paginator.count > paginator.per_page, + 'getvars': "&%s" % getvars.urlencode() } except KeyError: return u''