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

11 weergaven
Naar het eerste ongelezen bericht

Django

ongelezen,
22 mei 2018, 13:04:0122-05-2018
aan 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

ongelezen,
22 mei 2018, 16:25:5422-05-2018
aan 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

ongelezen,
23 mei 2018, 16:15:3423-05-2018
aan 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

ongelezen,
23 mei 2018, 16:16:5723-05-2018
aan 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

ongelezen,
24 mei 2018, 05:59:5324-05-2018
aan 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

ongelezen,
27 mei 2018, 07:13:4627-05-2018
aan 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

ongelezen,
27 mei 2018, 19:06:0227-05-2018
aan 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

ongelezen,
30 mei 2018, 12:35:2430-05-2018
aan 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

ongelezen,
8 jun 2018, 06:08:0608-06-2018
aan 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

ongelezen,
8 jun 2018, 06:27:0208-06-2018
aan 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

ongelezen,
9 jun 2018, 14:32:4309-06-2018
aan 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

ongelezen,
27 jul 2018, 16:13:1827-07-2018
aan 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>

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten