{{{
{{ value | filter: "arg"}}
}}}
{{{
TemplateSyntaxError at /
Could not parse the remainder: ': "arg"' from 'value | filter: "arg"'
}}}
It would be better to allow spaces between them.
--
Ticket URL: <https://code.djangoproject.com/ticket/29457>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* owner: nobody => oliver
--
Ticket URL: <https://code.djangoproject.com/ticket/29457#comment:1>
Comment (by oliver):
[https://github.com/django/django/pull/10009]
I added "\s*" next to "(arg_sep)"
{{{
filter_raw_string = r"""
^(?P<constant>%(constant)s)|
^(?P<var>[%(var_chars)s]+|%(num)s)|
(?:\s*%(filter_sep)s\s*
(?P<filter_name>\w+)
(?:%(arg_sep)s\s*
(?:
(?P<constant_arg>%(constant)s)|
(?P<var_arg>[%(var_chars)s]+|%(num)s)
)
)?
)""" % {
'constant': constant_string,
'num': r'[-+\.]?\d[\d\.e]*',
'var_chars': r'\w\.',
'filter_sep': re.escape(FILTER_SEPARATOR),
'arg_sep': re.escape(FILTER_ARGUMENT_SEPARATOR),
}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29457#comment:2>
* status: assigned => closed
* needs_docs: 0 => 1
* resolution: => wontfix
* needs_tests: 0 => 1
Comment:
Hi Oliver. Thanks for the input here.
I don't think we can just introduce a syntax change to the DTL without
some discussion around that.
I'm not sure a consensus would form in favour of the change, but we need
to check.
As such I'm going to close this as `wontfix`.
If you want to push this forwards please post to the
[https://groups.google.com/forum/#!forum/django-developers Django
Developers mailing list] explaining your proposed change and the reasons
for it. (Please link here and to the PR on GitHub.)
If there's a consensus around the change then we can re-open this ticket
and the PR.
If we were to make this change, it would need tests, and the new syntax
would need to be documented too.
Thanks again.
--
Ticket URL: <https://code.djangoproject.com/ticket/29457#comment:3>
Old description:
> In the template filter system now, spaces between augment separator and
> augments are not allowed.
> For example, the following template code generates the following error.
>
> {{{
> {{ value | filter: "arg"}}
> }}}
>
> {{{
> TemplateSyntaxError at /
> Could not parse the remainder: ': "arg"' from 'value | filter: "arg"'
> }}}
>
> It would be better to allow spaces between them.
New description:
In the template filter system, spaces between augment separator and
augments are not allowed.
For example, the following template code generates the following error.
{{{
{{ value | filter: "arg"}}
}}}
{{{
TemplateSyntaxError at /
Could not parse the remainder: ': "arg"' from 'value | filter: "arg"'
}}}
It would be better to allow spaces between them.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29457#comment:4>
Old description:
> In the template filter system, spaces between augment separator and
> augments are not allowed.
> For example, the following template code generates the following error.
>
> {{{
> {{ value | filter: "arg"}}
> }}}
>
> {{{
> TemplateSyntaxError at /
> Could not parse the remainder: ': "arg"' from 'value | filter: "arg"'
> }}}
>
> It would be better to allow spaces between them.
New description:
In the template filter system, spaces between augment separator and
augments generate error.
For example, the following template code generates the following error.
{{{
{{ value | filter: "arg"}}
}}}
{{{
TemplateSyntaxError at /
Could not parse the remainder: ': "arg"' from 'value | filter: "arg"'
}}}
It would be better to allow spaces between them.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29457#comment:5>
Comment (by oliver):
Replying to [comment:3 Carlton Gibson]:
Thanks for the review!
Are there any reasons that not allow spaces between separator and
argument?
> Hi Oliver. Thanks for the input here.
>
> I don't think we can just introduce a syntax change to the DTL without
some discussion around that.
> I'm not sure a consensus would form in favour of the change, but we need
to check.
>
> As such I'm going to close this as `wontfix`.
>
> If you want to push this forwards please post to the
[https://groups.google.com/forum/#!forum/django-developers Django
Developers mailing list] explaining your proposed change and the reasons
for it. (Please link here and to the PR on GitHub.)
>
> If there's a consensus around the change then we can re-open this ticket
and the PR.
>
> If we were to make this change, it would need tests, and the new syntax
would need to be documented too.
>
> Thanks again.
--
Ticket URL: <https://code.djangoproject.com/ticket/29457#comment:6>
Comment (by Tim Graham):
I agree with the wontfix decision. The arguments are described on the
[https://groups.google.com/d/topic/django-
developers/d4x7X91OLvQ/discussion django-developers thread].
--
Ticket URL: <https://code.djangoproject.com/ticket/29457#comment:7>