From: leidel Date: Sat, 16 Aug 2008 19:27:10 +0000 (+0000) Subject: fixed issue #14, patch from Martin Mahner X-Git-Tag: 1.0.6~32 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/d328dc6fe3c27a70dfdbf003227edbf1d7cce40c?ds=inline;hp=184a0afb64cc0bb105abea431bdbc8a5f1b0999c fixed issue #14, patch from Martin Mahner git-svn-id: https://django-pagination.googlecode.com/svn/trunk@25 7f1efe38-554e-0410-b69d-834cb44da2d5 --- diff --git a/pagination/templatetags/pagination_tags.py b/pagination/templatetags/pagination_tags.py index 55e5392..499db41 100644 --- a/pagination/templatetags/pagination_tags.py +++ b/pagination/templatetags/pagination_tags.py @@ -8,9 +8,9 @@ from django.core.paginator import Paginator, QuerySetPaginator, InvalidPage register = template.Library() -DEFAULT_PAGINATION = 20 -DEFAULT_WINDOW = 4 -DEFAULT_ORPHANS = 0 +DEFAULT_PAGINATION = getattr(settings, 'PAGINATION_DEFAULT_PAGINATION', 20) +DEFAULT_WINDOW = getattr(settings, 'PAGINATION_DEFAULT_WINDOW', 4) +DEFAULT_ORPHANS = getattr(settings, 'PAGINATION_DEFAULT_ORPHANS', 0) def do_autopaginate(parser, token): """ @@ -197,4 +197,4 @@ def paginate(context, window=DEFAULT_WINDOW): except KeyError: return {} register.inclusion_tag('pagination/pagination.html', takes_context=True)(paginate) -register.tag('autopaginate', do_autopaginate) \ No newline at end of file +register.tag('autopaginate', do_autopaginate)