Context,
Library,
Node,
- TOKEN_BLOCK,
TemplateSyntaxError,
Variable,
loader,
)
+
+try:
+ from django.template.base import TOKEN_BLOCK
+except ImportError: # Django < 1.8
+ from django.template import TOKEN_BLOCK
+
from django.template.loader import select_template
from django.utils.text import unescape_string_literal
self.multiple_paginations = multiple_paginations
def render(self, context):
- if self.multiple_paginations or getattr(context, "paginator", None):
+ # Save multiple_paginations state in context
+ if self.multiple_paginations and 'multiple_paginations' not in context:
+ context['multiple_paginations'] = True
+
+ if context.get('multiple_paginations') or getattr(context, "paginator", None):
page_suffix = '_%s' % self.queryset_var
else:
page_suffix = ''