summaryrefslogtreecommitdiff
path: root/django/views/generic/list_detail.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-09-14 01:01:02 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-09-14 01:01:02 +0000
commit87e77ffca0a7df59ff9407ef30a2baa90f1d872d (patch)
tree94a098a50cb4a2b1cb68da3e94f6564e2b9caf4e /django/views/generic/list_detail.py
parentcb9db449380d80f1e5856e64fd7cde15da63a315 (diff)
downloaddjango-87e77ffca0a7df59ff9407ef30a2baa90f1d872d.tar.gz
Fixed #1795 -- Added page_range to paginators in generic list views. Thanks to polarcowz@gmail.com and Marc Fargas <telenieko@telenieko.com> for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/views/generic/list_detail.py')
-rw-r--r--django/views/generic/list_detail.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/views/generic/list_detail.py b/django/views/generic/list_detail.py
index f5616b9745..c4a8cd3e05 100644
--- a/django/views/generic/list_detail.py
+++ b/django/views/generic/list_detail.py
@@ -39,6 +39,8 @@ def object_list(request, queryset, paginate_by=None, page=None,
first_on_page
the result number of the first object in the
object_list (1-indexed)
+ page_range:
+ A list of the page numbers (1-indexed).
"""
if extra_context is None: extra_context = {}
queryset = queryset._clone()
@@ -67,6 +69,7 @@ def object_list(request, queryset, paginate_by=None, page=None,
'first_on_page': paginator.first_on_page(page - 1),
'pages': paginator.pages,
'hits' : paginator.hits,
+ 'page_range' : paginator.page_range
}, context_processors)
else:
c = RequestContext(request, {