Opened 7 years ago

Closed 3 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 7 years ago by swilly

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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

comment:2 Changed 7 years ago by swilly

  • Resolution invalid deleted
  • Status changed from closed to 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 Changed 7 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to Core framework

comment:4 Changed 7 years ago by Alex

  • Triage Stage changed from Unreviewed to Design decision needed

comment:5 Changed 7 years ago by stavros

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 5 years ago by julien

  • Severity set to Normal
  • Type set to New feature

comment:7 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:8 Changed 4 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:9 Changed 3 years ago by aaugustin

  • Status changed from reopened to new

comment:10 Changed 3 years ago by jacob

  • Resolution set to invalid
  • Status changed from new to 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.

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