From: Radek Czajka Date: Thu, 19 Oct 2023 11:34:43 +0000 (+0200) Subject: Allow explicit page suffix. X-Git-Tag: 2.2.7 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/d59ab69808dc37e61a7179cdc370a1fec48c7f49?ds=inline Allow explicit page suffix. --- diff --git a/fnp_django_pagination/__init__.py b/fnp_django_pagination/__init__.py index 1e68b19..be5cf9a 100644 --- a/fnp_django_pagination/__init__.py +++ b/fnp_django_pagination/__init__.py @@ -34,4 +34,4 @@ tools throughout a django application. """ -__version__ = (2, 2, 6, "final", 0) +__version__ = (2, 2, 7, "final", 0) diff --git a/fnp_django_pagination/templatetags/pagination_tags.py b/fnp_django_pagination/templatetags/pagination_tags.py index 015e19c..3d6a973 100644 --- a/fnp_django_pagination/templatetags/pagination_tags.py +++ b/fnp_django_pagination/templatetags/pagination_tags.py @@ -142,7 +142,9 @@ class AutoPaginateNode(Node): if self.multiple_paginations and 'multiple_paginations' not in context: context['multiple_paginations'] = True - if context.get('multiple_paginations') or getattr(context, "paginator", None): + if context.get('page_suffix'): + page_suffix = context['page_suffix'] + elif context.get('multiple_paginations') or getattr(context, "paginator", None): page_suffix = '_%s' % self.queryset_var else: page_suffix = ''