From fdc181dfc7a0d4021bf0509bcba680acf9c98c36 Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Wed, 11 Aug 2010 10:43:11 -0400 Subject: [PATCH] Paginator returns page.object_list as objects if a page exists. --- models/pages.py | 2 +- utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/models/pages.py b/models/pages.py index 183b018..9d02c79 100644 --- a/models/pages.py +++ b/models/pages.py @@ -108,7 +108,7 @@ class Page(View): return self.template.django_template.render(Context(context)) def render_to_response(self, node, request, path=None, subpath=None, extra_context=None): - return HttpResponse(self.render_to_string(node, request, path, subpath, context), mimetype=self.template.mimetype) + return HttpResponse(self.render_to_string(node, request, path, subpath, extra_context), mimetype=self.template.mimetype) def __unicode__(self): return self.title diff --git a/utils.py b/utils.py index 11f9848..efd9f98 100644 --- a/utils.py +++ b/utils.py @@ -99,5 +99,7 @@ def paginate(objects, per_page=None, page_number=1): page = paginator.page(page_number) except EmptyPage: page = None + else: + objects = page.object_list return paginator, page, objects -- 2.20.1