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
(?:
(?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),
}
allowing spaces can be done by adding \s* after (arg_sep)s
2018년 6월 5일 화요일 오전 11시 17분 51초 UTC+9, [email protected] 님의 말:
>
> Currently, spaces between filter separator( | ) and filter name is
> allowed. Also, value name and filter separator.
> So, following is allowed.
>
> {{ value | filter:"arg" }}
> {{ value|filter:"arg" }}
>
> But, following is not allowed.
>
> {{ value|filter: "arg" }}
>
> users are confused by the inconsistency.
>
> I think that either the error message or syntax should be improved.
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" 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].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/2f27f356-e225-441a-8fd2-4f49d23f5d14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.