diff options
author | Adrian Holovaty <adrian@holovaty.com> | 2006-06-03 22:06:48 +0000 |
---|---|---|
committer | Adrian Holovaty <adrian@holovaty.com> | 2006-06-03 22:06:48 +0000 |
commit | fc2a02f9666a2cd610443fc2107560b9832a017a (patch) | |
tree | 1bf56b9d0fcab25da4105a4e3f7c2872b0e6c107 /django/views/generic/list_detail.py | |
parent | 9b86db9bf2407f408468566b3f48a8444cb66f83 (diff) | |
download | django-fc2a02f9666a2cd610443fc2107560b9832a017a.tar.gz |
Fixed #2075 -- Added 'page' parameter to object_list generic view. Thanks, kanashii@kanashii.ca
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3071 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/views/generic/list_detail.py')
-rw-r--r-- | django/views/generic/list_detail.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/django/views/generic/list_detail.py b/django/views/generic/list_detail.py index 5bd5b87d33..bd0f17c56a 100644 --- a/django/views/generic/list_detail.py +++ b/django/views/generic/list_detail.py @@ -4,8 +4,8 @@ from django.core.xheaders import populate_xheaders from django.core.paginator import ObjectPaginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist -def object_list(request, queryset, paginate_by=None, allow_empty=False, - template_name=None, template_loader=loader, +def object_list(request, queryset, paginate_by=None, page=None, + allow_empty=False, template_name=None, template_loader=loader, extra_context=None, context_processors=None, template_object_name='object', mimetype=None): """ @@ -38,7 +38,8 @@ def object_list(request, queryset, paginate_by=None, allow_empty=False, queryset = queryset._clone() if paginate_by: paginator = ObjectPaginator(queryset, paginate_by) - page = request.GET.get('page', 1) + if not page: + page = request.GET.get('page', 1) try: page = int(page) object_list = paginator.get_page(page - 1) |