Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1162 closed enhancement (wontfix)

[patch] added range0, range1 filter

Reported by: nkeric@… Owned by: adrian
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hey guys,

I found it useful to have a range filter which acts (partly) like the python's range(), so I added this two filters: range0 - 0-index; range1 - 1-index.

It can be used like this (in a paginated page):

{% for page_number in pages|range1 %}

<a href="./?page={ forloop.counter0 }}">{{ page_number }}</a>

{% endfor %}

Hope this patch is useful for other people too :)

Attachments (1)

defaultfilters.diff (700 bytes) - added by nkeric@… 9 years ago.
added range0 and range1 filter

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by nkeric@…

added range0 and range1 filter

comment:1 Changed 9 years ago by jacob

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

This is out of the scope of the built-in templates.

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