Ticket #1617 (closed defect: fixed)
Paginate should handle out of bound pages
| Reported by: | roger.demetrescu | Owned by: | roger.demetrescu |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.4 |
| Component: | TurboGears | Version: | 1.0.3.2 |
| Severity: | normal | Keywords: | paginate |
| Cc: |
Description
There is a full discussion on ML about this topic:
http://groups.google.com/group/turbogears/browse_thread/thread/751f9013caf40801/9084e2e658e65cd1
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:2 Changed 4 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).
Note: See
TracTickets for help on using
tickets.