#35452: There seems to an issue with the doc on django's orphans and its
implementation
-------------------------------------+-------------------------------------
               Reporter:  Strapchay  |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  5.0
  (Other)                            |       Keywords:  pagination,
               Severity:  Normal     |  paginator
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 The documentation
 
https://docs.djangoproject.com/en/4.2/ref/paginator/#django.core.paginator.Paginator.orphans
 says the orphan would append values which are orphans which don't fit into
 the context of the per_page of the paginator to the last_page of the
 paginator if the remaining values is less than or equal to the specified
 orphan value. However, there seems to be a logical error in how it is
 implemented. The orphan only applies if the specified orphan value is
 exactly the value specified and not lesser. And also in situations where
 the page_size specified is lesser than the orphans, the values of the next
 page including the orphan are instead added to the intial page which
 disregards the pagination.

 So in a situation where i specify a page_size of 2 and have 7 queryset
 data and specified the orphans to be 3, it returns only a single page
 making it returned value 7 and similar if the queryset data is 5 and the
 orphans is 3, however, if i specify the orphans to be 1 the pagination
 behaves as expected
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35452>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f76c336d2-bc4734da-bd81-472c-b9e7-c26e621442a8-000000%40eu-central-1.amazonses.com.

Reply via email to