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 , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
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 , 16 years ago
Component: | Uncategorized → Core framework |
---|
comment:4 by , 15 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:5 by , 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 , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:9 by , 12 years ago
Status: | reopened → new |
---|
comment:10 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
I didn't realized this was accessible through the page_obj variable.