loader,
)
-try:
- from django.template.base import TOKEN_BLOCK
-except ImportError: # Django < 1.8
- from django.template import TOKEN_BLOCK
+from django.template.base import TokenType
+TOKEN_BLOCK = TokenType.BLOCK
from django.template.loader import select_template
from django.utils.text import unescape_string_literal
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 = ''
new_context = paginate(context)
if self.template:
template_list.insert(0, self.template)
- return loader.render_to_string(template_list, new_context,
- context_instance = context)
-
+ return loader.render_to_string(template_list, new_context)
def do_paginate(parser, token):