Opened 17 years ago

Closed 17 years ago

#6924 closed (invalid)

Paginator TemplateTag

Reported by: trbs Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: paginator, templatetag
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've created a TemplateTag for using the new Paginator class directly from a template.
It might be nice to add this to the documentation of Paginator or maybe even the django code page.

Ofcourse most people will use the paginator from a view or a generic view, but there are also some
quite good use cases for paginating something directly in a template. For instance a related list or
a generic list of things which is not the main object_list of the page.

The tag and usage examples are at: http://www.djangosnippets.org/snippets/673/

It currently lacks support for 'first' and 'last' keywords on the page parameter. I'll add it soon.

Change History (1)

comment:1 by Marc Fargas, 17 years ago

Resolution: invalid
Status: newclosed

One of the points in django's template system is to avoid "programming" in the templates, so the paginator *should* be made in the view and passed to the template.
On the other side, django docs *do not* link outside themselves (or should not). Adding to code.djangoproject.com can be done by anyone PaginatorTag.

So either:

  • You can edit your own wiki page
  • You can link you snippet from the page I linked above
  • You can bring this to django-developers for discussion and if aplicable reopen the ticket. But, please, do it after we get 1.0 out! ;)
Note: See TracTickets for help on using tickets.
Back to Top