Opened 7 years ago

Closed 7 years ago

#19165 closed New feature (invalid)

add first and last page to paginator

Reported by: ciro.santilli@… 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



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:

Change History (3)

comment:1 Changed 7 years ago by Łukasz Rekucki

Triage Stage: UnreviewedDesign decision needed

Both the first and last page can be accessed easily through the paginator:

first_page =
last_page =

IMHO, there is no need for anything like first_page_number as it's always 1 and page.last_page_number doesn't save much compared to page.paginator.num_pages. But maybe I'm missing something.

comment:2 Changed 7 years ago by Ciro Duran Santilli <ciro.santilli@…>

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:


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 Changed 7 years ago by Claude Paroz

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top