From 965be4085fb0c68c6462f131b08170c6ffa4fb3f Mon Sep 17 00:00:00 2001 From: Alen Mujezinovic Date: Wed, 3 Aug 2011 14:50:11 +0100 Subject: [PATCH 1/1] Pass the template context to the pagination template --- linaro_django_pagination/templatetags/pagination_tags.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/linaro_django_pagination/templatetags/pagination_tags.py b/linaro_django_pagination/templatetags/pagination_tags.py index 1a84c57..b447625 100644 --- a/linaro_django_pagination/templatetags/pagination_tags.py +++ b/linaro_django_pagination/templatetags/pagination_tags.py @@ -40,6 +40,7 @@ from django.template import ( TOKEN_BLOCK, TemplateSyntaxError, Variable, + loader, ) from django.template.loader import select_template from django.utils.text import unescape_string_literal @@ -185,11 +186,9 @@ class PaginateNode(Node): to_return = paginate(context) if self.template: template_list.insert(0, self.template) - t = select_template(template_list) - if not t: - return None - context = Context(to_return) - return t.render(context) + return loader.render_to_string(template_list, to_return, + context_instance = context) + def do_paginate(parser, token): -- 2.20.1