Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1162 closed enhancement (wontfix)

[patch] added range0, range1 filter

Reported by: nkeric@… Owned by: Adrian Holovaty
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: no UI/UX: no

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@… 18 years ago.
added range0 and range1 filter

Download all attachments as: .zip

Change History (2)

by nkeric@…, 18 years ago

Attachment: defaultfilters.diff added

added range0 and range1 filter

comment:1 by Jacob, 18 years ago

Resolution: wontfix
Status: newclosed

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

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