From 4d29cae46769745f41283b7f9746326ebdd04338 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 4 Jul 2006 03:44:56 +0000 Subject: [PATCH] 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 --- django/template/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)