Opened 4 years ago

Closed 4 years ago

#31647 closed New feature (wontfix)

Add "times" template filter.

Reported by: Eray Erdin Owned by: nobody
Component: contrib.humanize Version: 3.0
Severity: Normal Keywords: template, humanize, filter, tag, tags
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django's built-in humanize module/app already contains many useful filter tags.

https://docs.djangoproject.com/en/stable/ref/contrib/humanize/

However, it lacks a filter for converting integers to "once", "twice", "three times". Examples:

{{ 1|times }} {# once #}
{{ 2|times }} {# twice #}
{{ 3|times }} {# three times #}

Change History (1)

comment:1 by Mariusz Felisiak, 4 years ago

Component: Template systemcontrib.humanize
Resolution: wontfix
Status: newclosed
Summary: "once", "twice", "three times" on humanizeAdd "times" template filter.

I don't think Django is going to add more built in template filters. It's really straightforward to add a custom one and there are ​lots of third-party libraries which can be developed more rapidly outside of Django.

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