Opened 16 years ago

Closed 12 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

Description

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: http://www.djangosnippets.org/snippets/628/

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 by swilly, 16 years ago

Resolution: invalid
Status: newclosed

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

comment:2 by swilly, 16 years ago

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 by Thejaswi Puthraya, 16 years ago

Component: UncategorizedCore framework

comment:4 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:5 by Stavros Korokithakis, 15 years ago

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 by Julien Phalip, 14 years ago

Severity: Normal
Type: New feature

comment:7 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 by Aymeric Augustin, 12 years ago

Status: reopenednew

comment:10 by Jacob, 12 years ago

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