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, oli...@kidsnote.com 님의 말:
>
> 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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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.

Reply via email to