Ticket #3391: generic_object_list.patch
File generic_object_list.patch, 1.6 KB (added by , 18 years ago) |
---|
-
django/views/generic/list_detail.py
48 48 object_list = [] 49 49 else: 50 50 raise Http404 51 start = 1 52 if page > 1: 53 start = (page - 1) * paginate_by + 1 54 55 end = start + paginate_by - 1 56 if end > paginator.hits: 57 end = paginator.hits 58 51 59 c = RequestContext(request, { 52 60 '%s_list' % template_object_name: object_list, 53 61 'is_paginated': paginator.pages > 1, … … 58 66 'next': page + 1, 59 67 'previous': page - 1, 60 68 'pages': paginator.pages, 69 'pages_list': range(1, paginator.pages+1), 70 'page_start': start, 71 'page_end': end, 61 72 'hits' : paginator.hits, 62 73 }, context_processors) 63 74 else: -
docs/generic_views.txt
754 754 755 755 * ``pages``: The total number of pages, as an integer. 756 756 757 * ``pages_list``: The list of page numbers (integers). 758 759 * ``page_start``: The number of the first item on the page. 760 761 * ``page_end``: The number of the last item on the page. 762 757 763 * ``hits``: The total number of objects across *all* pages, not just this 758 764 page. 759 765