mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
6b383afd39
commit
4d29cae467
|
@ -614,7 +614,11 @@ def resolve_variable(path, context):
|
||||||
|
|
||||||
(The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')
|
(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
|
number_type = '.' in path and float or int
|
||||||
try:
|
try:
|
||||||
current = number_type(path)
|
current = number_type(path)
|
||||||
|
|
Loading…
Reference in New Issue