Opened 17 years ago
Closed 17 years ago
#4809 closed (duplicate)
supply a pagination templatetag that takes in a paginator object
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | 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've seen a few different pagination template tags out there, one example is PaginatorTag. I think this is such a common thing that it should be added to Django. There is a good bit of logic and template code that this sort of template tag needs, and it seems a bit un-DRY to have to add such a chunk of code everywhere you want a list of pages to appear.
I think with a few configuration options, we could make 90% of users happy. Options like:
- behavior -- [full] list / [surrounding] X pages / [current] page only
- show first/last -- True / False
- show previous/next -- True / False
The template tag might look something like:
{% paginator <paginator_object> behavior full firstlast True prevnext True %}
This gets even better (for generic views) if #4805 is implemented.
Change History (3)
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
I think this would be a good implementation, but let's keep the discussion in/around #3169.
http://groups.google.com/group/django-developers/browse_thread/thread/93646ef6a168ad6a/1bb42300896b1403