#15575 closed (fixed)
MultipleObjectMixin.paginate_queryset always returns is_paginated=True
| Reported by: | Owned by: | Ivan Virabyan | |
|---|---|---|---|
| Component: | Generic views | Version: | dev |
| Severity: | Keywords: | blocker | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | yes | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
Documentation says:
is_paginated: A boolean representing whether the results are paginated. Specifically ... if the available objects do not span multiple pages.
But is_paginated is True even when objects do not span multiple pages.
def paginate_queryset(self, queryset, page_size):
...
return (paginator, page, page.object_list, True)
As you can see, it always sets the last element of tuple to True, which is value for is_paginated.
Attachments (2)
Change History (6)
by , 15 years ago
| Attachment: | is_paginated.diff added |
|---|
comment:1 by , 15 years ago
| Keywords: | blocker added |
|---|---|
| Needs tests: | set |
| Patch needs improvement: | set |
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 15 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.
Following the lead from the old list_detail views, the check should actually be page_obj.has_other_pages(), not just num_pages > 1.
This is a bug in a new feature, so it needs to be addressed before 1.3 final.