Code

Ticket #2574: list_detail.diff

File list_detail.diff, 1.9 KB (added by grimboy, 8 years ago)
Line 
18,9c9,11
2<         allow_empty=False, template_name=None, template_loader=loader,
3<         extra_context=None, context_processors=None, template_object_name='object',
4---
5>         allow_empty=False, page_list_surround=0, page_list_edges=0,
6>         template_name=None, template_loader=loader, extra_context=None,
7>         context_processors=None, template_object_name='object',
835a38,50
9>         page_list
10>             a list of containing the page numbers surrounding
11>             the current page and the page numbers at the edge
12>             (begining and end) depending on the arguments
13>             passed
14>         first_on_page
15>             the result number of the first object in the
16>             object_list (where the objects are numbered
17>             starting at 1)
18>         last_on_page
19>             the result number of the last of object in the
20>             object_list (where the objects are numbered
21>             starting at 1)
2237,38c52,55
23<     if extra_context is None: extra_context = {}
24<     queryset = queryset._clone()
25---
26>     if extra_context is None:
27>         extra_context = {}
28>     if type(queryset) != type([]):
29>         queryset = queryset._clone()
3061a79,81
31>             'first_on_page': paginator.first_on_page(page - 1),
32>             'last_on_page': paginator.last_on_page(page - 1),
33>             'page_list': paginator.page_list(page, page_list_surround, page_list_edges),
3469a90
35>             
3676,77c97,101
37<         model = queryset.model
38<         template_name = "%s/%s_list.html" % (model._meta.app_label, model._meta.object_name.lower())
39---
40>         if type(queryset) == type([]):
41>             raise AttributeError, "Generic list view must be called with template_name when queryset is a list."
42>         else:
43>             model = queryset.model
44>             template_name = "%s/%s_list.html" % (model._meta.app_label, model._meta.object_name.lower())