#1162 closed enhancement (wontfix)
[patch] added range0, range1 filter
Reported by: | 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)
Change History (2)
by , 19 years ago
Attachment: | defaultfilters.diff added |
---|
comment:1 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This is out of the scope of the built-in templates.
Note:
See TracTickets
for help on using tickets.
added range0 and range1 filter