[Django] #29433: templatefilter "make_list" should receive a optional split variable

11 views
Skip to first unread message

Django

unread,
May 22, 2018, 1:04:01 PM5/22/18
to django-...@googlegroups.com
#29433: templatefilter "make_list" should receive a optional split variable
-------------------------------------+-------------------------------------
Reporter: danilovmy | Owner: nobody
Type: New | Status: new
feature |
Component: Template | Version:
system |
Severity: Normal | Keywords: templatefilter,
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
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']
......

--
Ticket URL: <https://code.djangoproject.com/ticket/29433>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 22, 2018, 4:25:54 PM5/22/18
to django-...@googlegroups.com
#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

unread,
May 23, 2018, 4:15:34 PM5/23/18
to django-...@googlegroups.com
#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
---------------------------------+--------------------------------------

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>

Django

unread,
May 23, 2018, 4:16:57 PM5/23/18
to django-...@googlegroups.com
#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
---------------------------------+--------------------------------------
Changes (by Jeff):

* 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>

Django

unread,
May 24, 2018, 5:59:53 AM5/24/18
to django-...@googlegroups.com
#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
---------------------------------+--------------------------------------

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>

Django

unread,
May 27, 2018, 7:13:46 AM5/27/18
to django-...@googlegroups.com
#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
---------------------------------+--------------------------------------

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>

Django

unread,
May 27, 2018, 7:06:02 PM5/27/18
to django-...@googlegroups.com
#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: Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by Tim Graham):

* 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>

Django

unread,
May 30, 2018, 12:35:24 PM5/30/18
to django-...@googlegroups.com
#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: Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------

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>

Django

unread,
Jun 8, 2018, 6:08:06 AM6/8/18
to django-...@googlegroups.com
#29433: templatefilter "make_list" should receive a optional split variable
---------------------------------+-----------------------------------------
Reporter: danilovmy | Owner: hehaha
Type: New feature | Status: assigned

Component: Template system | Version:
Severity: Normal | Resolution:
Keywords: templatefilter, | Triage Stage: Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by hehaha):

* owner: nobody => hehaha
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:8>

Django

unread,
Jun 8, 2018, 6:27:02 AM6/8/18
to django-...@googlegroups.com
#29433: templatefilter "make_list" should receive a optional split variable
---------------------------------+-----------------------------------------
Reporter: danilovmy | Owner: (none)

Type: New feature | Status: new
Component: Template system | Version:
Severity: Normal | Resolution:
Keywords: templatefilter, | Triage Stage: Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by hehaha):

* owner: hehaha => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:9>

Django

unread,
Jun 9, 2018, 2:32:43 PM6/9/18
to django-...@googlegroups.com
#29433: templatefilter "make_list" should receive a optional split variable
---------------------------------+-----------------------------------------
Reporter: danilovmy | Owner: Prakash

Type: New feature | Status: assigned
Component: Template system | Version:
Severity: Normal | Resolution:
Keywords: templatefilter, | Triage Stage: Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by Prakash):

* owner: nobody => Prakash


* status: new => assigned


Comment:

Assigning to myself

--
Ticket URL: <https://code.djangoproject.com/ticket/29433#comment:8>

Django

unread,
Jul 27, 2018, 4:13:18 PM7/27/18
to django-...@googlegroups.com
#29433: templatefilter "make_list" should receive a optional split variable
---------------------------------+-----------------------------------------
Reporter: danilovmy | Owner: Prakash
Type: New feature | Status: closed
Component: Template system | Version:
Severity: Normal | Resolution: wontfix

Keywords: templatefilter, | Triage Stage: Someday/Maybe
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by Tim Graham):

* 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>

Reply all
Reply to author
Forward
0 new messages