Opened 12 years ago
Closed 12 years ago
#19165 closed New feature (invalid)
add first and last page to paginator
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | 1.4 |
Severity: | Normal | Keywords: | paginator, last page, first page |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Hi,
If it does not exist, add a first/last page method to the Page object returned by django.core.paginator import Paginator,
so that web pages can easily do first/last page links.
If it exists, add it to the docs at:
https://docs.djangoproject.com/en/dev/topics/pagination/#django.core.paginator.Page
Change History (3)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 12 years ago
Aw, should have read better the tutorial, I hadn't seen that the Page object (which is what is usually passed to templates) has a Paginator field.
In this case, we can just write:
page.paginator.num_pages
for the last page.
So I agree adding more fields to the Page object would be a minor improvement.
This ticket can be closed on my part.
comment:3 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Both the first and last page can be accessed easily through the paginator:
IMHO, there is no need for anything like
first_page_number
as it's always 1 andpage.last_page_number
doesn't save much compared topage.paginator.num_pages
. But maybe I'm missing something.