it should to work too:
{% with my_list='i#am#stupid#user'|make_list:'#' %}
# my_list=['i','am','stupid','user']
......
--
Ticket URL: <https://code.djangoproject.com/ticket/29433>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
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>
Comment (by Jeff):
I feel somewhat ambivalent about this as well. If we decide to add the
split feature, would it make more sense to add a new tag "split" instead
of changing the behavior or "make_list" Do we want to add this at all?
Replying to [comment:1 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:2>
* cc: Jeff (added)
Comment:
I feel somewhat ambivalent about this as well. If we decide to add the
split feature, would it make more sense to add a new tag "split" instead
of changing the behavior or "make_list" Do we want to add this at all?
Replying to [comment:1 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:3>
Comment (by Kamil):
If we decide to do it, I will be happy to do it.
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:4>
Comment (by Ingo Klöcker):
I also think that adding a {{{split}}} filter (there's already a
{{{join}}} filter) is useful. Sometimes we store lists of strings in
simple CharFields and for display we need to replace the separator with a
more human-friendly separator.
So, who's going to decide if it shall be added?
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:5>
* stage: Unreviewed => Someday/Maybe
Comment:
Write to the DevelopersMailingList to get a consensus about how to
proceed.
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:6>
Comment (by Kamil):
You can see the discussion
[https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg
/django-developers/DVDuhKXPweU/LSUdoQfDAQAJ here].
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:7>
* owner: nobody => hehaha
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:8>
* owner: hehaha => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:9>
* owner: nobody => Prakash
* status: new => assigned
Comment:
Assigning to myself
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:8>
* status: assigned => closed
* resolution: => wontfix
Comment:
Closing as the mailing list didn't yield consensus to add this.
--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:9>