Ticket #2075: list_detail.patch
File list_detail.patch, 965 bytes (added by , 18 years ago) |
---|
-
list_detail.py
4 4 from django.core.paginator import ObjectPaginator, InvalidPage 5 5 from django.core.exceptions import ObjectDoesNotExist 6 6 7 def object_list(request, queryset, paginate_by=None, allow_empty=False,7 def object_list(request, queryset, paginate_by=None, page=None, allow_empty=False, 8 8 template_name=None, template_loader=loader, 9 9 extra_context={}, context_processors=None, template_object_name='object', 10 10 mimetype=None): … … 37 37 queryset = queryset._clone() 38 38 if paginate_by: 39 39 paginator = ObjectPaginator(queryset, paginate_by) 40 page = request.GET.get('page', 1) 40 if not page: 41 page = request.GET.get('page', 1) 41 42 try: 42 43 page = int(page) 43 44 object_list = paginator.get_page(page - 1)