#27814: Unclear explanation of orphans in Paginator
-------------------------------------+------------------------------------
Reporter: Pablo Oubiña | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: paginator, orphans, | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Comment (by Pablo Oubiña):
Replying to [comment:1 Tim Graham]:
> I think the correct definition is "One less than the minimum number of
items allowed on the last page." -- agreed?
Hi Tim!
Much better, but it's still confusing. In the future maybe we should
consider the possibility of doing something like that:
{{{
>>> from django.core.paginator import Paginator
>>> objects = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
>>> p = Paginator(objects, 3, min_orphans=2)
>>> page2 = p.page(2)
>>> page2.object_list
output: ['d', 'e', 'f']
>>> page2.has_next()
output: True
>>> page3 = p.page(3)
>>> page3.object_list
output: ['g', 'h']
}}}
**Optional arguments**
''**min_orphans**: The minimum number of items allowed on the last page.''
It would be much more obvious. On the other hand, I know it implies
breaking backwards compatibility. Just and idea.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/27814#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.b6f3cff39573a9e40c69c47445bdd208%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.