Opened 10 years ago

Closed 6 years ago

#10995 closed New feature (invalid)

Improve paginator to account for very large page_range's

Reported by: swilly Owned by: nobody
Component: Core (Other) Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I think it would be beneficial to add some "digg-style" features to the Django paginator. Currently, if a user has a large number of pages returned by the 'page_range' template tag for generic views, etc., there is no way of reducing the page_range returned in a sane way without extending the current Paginator. Someone provided a snippet that exhibits this functionality here:

Ideally, I think would want to have something like +/- 5 pages from the current page and Previous/Next buttons before and after the current range when inside a large set. Alternatively, it could display +/- 5 pages from the current page and also 3 from the beginning/end next to First/Last buttons.

Change History (10)

comment:1 Changed 10 years ago by swilly

Resolution: invalid
Status: newclosed

I didn't realized this was accessible through the page_obj variable.

comment:2 Changed 10 years ago by swilly

Resolution: invalid
Status: closedreopened

I have played with the options available from 'page_obj' in the the object_list generic view template, and while it is easy to display a 'Next' or 'Previous' link, there really isn't much more readily available. This is better, but I'm reopening the ticket in hopes that someone will work on it a bit (if I don't get around to it first).

comment:3 Changed 10 years ago by Thejaswi Puthraya

Component: UncategorizedCore framework

comment:4 Changed 10 years ago by Alex Gaynor

Triage Stage: UnreviewedDesign decision needed

comment:5 Changed 9 years ago by Stavros Korokithakis

I'd like to +1 this. Perhaps one could pass an argument to page_range to specify how many pages they wanted returned in total, around the current one?

comment:6 Changed 8 years ago by Julien Phalip

Severity: Normal
Type: New feature

comment:7 Changed 7 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 Changed 7 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 Changed 6 years ago by Aymeric Augustin

Status: reopenednew

comment:10 Changed 6 years ago by Jacob

Resolution: invalid
Status: newclosed

This is pretty vague, and could encompass a variety of different things, some of them appropriate for Django, others not so much. So I'm going to close since since it's effectively not actionable. If you've got a specific patch, please feel free to open a new ticket and/or pull request.

Note: See TracTickets for help on using tickets.
Back to Top