Kaydet (Commit) 4d29cae4 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Refs #1400 -- Variable resolver now converts literal strings 'False' and 'True'…

Refs #1400 -- Variable resolver now converts literal strings 'False' and 'True' into booleans when used as template arguments. This is point 2 from ticket #1400. Thanks Kieren Holland.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 6b383afd
......@@ -614,7 +614,11 @@ def resolve_variable(path, context):
(The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')
"""
if path[0].isdigit():
if path == 'False':
path = False
elif path == 'True':
path = True
elif path[0].isdigit():
number_type = '.' in path and float or int
try:
current = number_type(path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment