#29433: templatefilter "make_list" should receive a optional split variable
---------------------------------+--------------------------------------
Reporter: danilovmy | Owner: nobody
Type: New feature | Status: new
Component: Template system | Version:
Severity: Normal | Resolution:
Keywords: templatefilter, | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+--------------------------------------
Old description:
> for use in template, for example:
> not only
> {% with my_list='i#am#stupid#user'|make_list %}
> #
> my_list=['i','#','a','m','#','s','t','u','p','i','d','#','u','s','e','r']
> ......
>
> it should to work too:
>
> {% with my_list='i#am#stupid#user'|make_list:'#' %}
> # my_list=['i','am','stupid','user']
> ......
New description:
for use in template, for example:
not only
{{{
{% with my_list='i#am#stupid#user'|make_list %}
#
my_list=['i','#','a','m','#','s','t','u','p','i','d','#','u','s','e','r']
}}}
......
it should to work too:
{{{
{% with my_list='i#am#stupid#user'|make_list:'#' %}
# my_list=['i','am','stupid','user']
}}}
......
--
Comment (by Tim Graham):
I'm on the fence. While I see the value, I'm not sure that promoting more
logic in templates in a good idea. It's fairly easy to write a custom
filter (I would call it "split") which I think would be more readable.
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.08e14770868241ce79fc081b465f1518%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.