#2576 closed enhancement (wontfix)
[patch] PaginatorPage object
| Reported by: | Chris Beaven | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | Core (Other) | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
class PaginatorPage: """ This class is used to work with a page of a paginator object. Pass a paginator object, and a valid page number. It uses the same methods as a paginator, except you do not need to use a page number. """
So it's just a page aware paginator object wrapper.
For example, if you have a paginator object in a view, you can set up a PaginatorPage object (passing the paginator and current page number) and then pass this object directly to your template.
- It can work in a different base (base-1 is nice to work with at a template level)
- It can return the next / previous page number
Attachments (1)
Change History (4)
by , 19 years ago
| Attachment: | paginatorpage.py added |
|---|
comment:1 by , 19 years ago
comment:2 by , 19 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Neat class, but a little too obscure for inclusion in Django. File it away in your bag of tricks, though :)
Note:
See TracTickets
for help on using tickets.
I'm thinking perhaps it should default to base 1 too.
i.e.
PaginatorPage(paginator, 0, base=1)instead of the currentbase=0default