Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1617 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

Paginate should handle out of bound pages

Reported by: roger.demetrescu Owned by: roger.demetrescu
Priority: normal Milestone: 1.0.4
Component: TurboGears Version:
Severity: normal Keywords: paginate


There is a full discussion on ML about this topic:


Thread summary:

  • page <= 0 should be handle as page = 1.
  • page > page_count should be handle as page = page_count.
  • page_count = 0 should bring empty data (as it is now).
  • paginate should provide a get_last_href(...) method which would ensure, at server-side, that page = page_count.

As an extra bonus, paginate could force redirects to correct this out of bound situations, so we can have the correct page number at URL.

This bonus behavior would be switched on with a parameter: "paginate.redirect_on_out_of_range"

Change History

comment:1 Changed 12 years ago by roger.demetrescu

  • Owner changed from anonymous to roger.demetrescu

comment:2 Changed 12 years ago by roger.demetrescu

  • Status changed from new to closed
  • Resolution set to fixed

Done, with some modifications:

  • There's no need to have paginate.get_last_href(...). paginate.href_last is used instead.
  • PaginateDataGrid? was modified to use those href_xxxx attributes from paginate object.
  • Another parameter was created: paginate.redirect_on_last_page (the name says it all).

Changes in [3735] and [3736].

Note: See TracTickets for help on using tickets.