﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8902	tags having problems with filtered variables using arguments with spacing	killiands	nobody	"If you want to do something like this:
{{{ {% with activity.start_date|date:""l j F"" as date1 %} }}}
You'll get this error:
{{{ Exception Value: u'with' expected format is 'value as name' }}}
This is due to this code:
{{{ 
    bits = list(token.split_contents())
    if len(bits) != 4 or bits[2] != ""as"":
        raise TemplateSyntaxError(""%r expected format is 'value as name'"" %
                                  bits[0])
}}}
First of all, maybe another bug: split_contents gave me a double """" on a filter as |cut:"" "", so I replaced it with contents.split() which worked fine for me.
Then, this error: len(bits) !=4 is actually overkill. The tag works like this: 0 -> tagname, 1-> a variable with filter, 2 -> as, 3 -> newvar. Actually you should not check if the ' '-splitted content is 4 long, you should check if [1] passes the compile_filter, which will throw it's own error.

I tried to write a regex or iteration that really checked if you did really passed 1 variable + filter(s), but that really isn't trivial, and the compile_filter function's error is actually clear enough.

I added a patch + test for the {% with %} tag only at the moment (because that's where I encountered the problem). However, other tags have the problem also."		closed	Template system	1.0		duplicate	template tags		Unreviewed	1	0	0	0	0	0
