summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2006-07-04 03:44:56 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2006-07-04 03:44:56 +0000
commit4d29cae46769745f41283b7f9746326ebdd04338 (patch)
tree7d7b0a5e87da68eb878e56b126b5dcf016ae3c1a
parent6b383afd39ee2e493a308cb5c70dfa880d27edf6 (diff)
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
-rw-r--r--django/template/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/template/__init__.py b/django/template/__init__.py
index 993de7304e..e8a4cfc744 100644
--- a/django/template/__init__.py
+++ b/django/template/__init__.py
@@ -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)