Opened 8 years ago

Closed 8 years ago

#4809 closed (duplicate)

supply a pagination templatetag that takes in a paginator object

Reported by: Gary Wilson <gary.wilson@…> Owned by: nobody
Component: Template system Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 8 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 8 years ago by ubernostrum

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

I think this would be a good implementation, but let's keep the discussion in/around #3169.

Note: See TracTickets for help on using tickets.
Back to Top