﻿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
2320	Template - Python, Tags, example	rvernica@…	Malcolm Tredinnick	"Hi,

I tried the example in the documentation page ""The Django template language: For Python programmers"" [http://www.djangoproject.com/documentation/templates_python/] section ""Writing custom template tags"" and I get errors.

1. When I use the tag I like:

{{{
{% current_time ""%Y-%M-%d %I:%M %p"" %}
}}}

I get:

{{{
Exception Type:  	TemplateSyntaxError
Exception Value: 	current_time takes 1 arguments
}}}

If I remove the spaces within the string argument:

{{{
{% current_time ""%Y-%M-%d%I:%M%p"" %}
}}}

it does not give this error.

2. In the ""Shortcut for simple tags"" case, I get:

{{{
Exception Type:  	AttributeError
Exception Value: 	'str' object has no attribute 'contents'
}}}

The error comes from line:

{{{
tag_name, format_string = token.contents.split(None, 1)
}}}

token variable is an empty string.
I use it with:

{{{
{% current_time ""%Y-%M-%d%I:%M%p"" %}
}}}

Thanks,
Ray"	defect	closed	Documentation	dev	normal	fixed			Unreviewed	0	0	0	0	0	0
