Code

Ticket #7005: object_list-orphans-support.diff

File object_list-orphans-support.diff, 1.0 KB (added by shadfc, 6 years ago)

patch against rev 7412 adding orphans support to object_list

Line 
1Index: views/generic/list_detail.py
2===================================================================
3--- views/generic/list_detail.py        (revision 7412)
4+++ views/generic/list_detail.py        (working copy)
5@@ -5,7 +5,7 @@
6 from django.core.exceptions import ObjectDoesNotExist
7 
8 def object_list(request, queryset, paginate_by=None, page=None,
9-        allow_empty=True, template_name=None, template_loader=loader,
10+        allow_empty=True, orphans=None, template_name=None, template_loader=loader,
11         extra_context=None, context_processors=None, template_object_name='object',
12         mimetype=None):
13     """
14@@ -45,7 +45,7 @@
15     if extra_context is None: extra_context = {}
16     queryset = queryset._clone()
17     if paginate_by:
18-        paginator = QuerySetPaginator(queryset, paginate_by, allow_empty_first_page=allow_empty)
19+        paginator = QuerySetPaginator(queryset, paginate_by, allow_empty_first_page=allow_empty, orphans=orphans)
20         if not page:
21             page = request.GET.get('page', 1)
22         try: