Django

Code

Changeset 3269

Show
Ignore:
Timestamp:
07/03/06 22:44:56 (2 years ago)
Author:
russellm
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/template/__init__.py

    r3268 r3269  
    615615    (The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.') 
    616616    """ 
    617     if path[0].isdigit(): 
     617    if path == 'False': 
     618        path = False 
     619    elif path == 'True': 
     620        path = True 
     621    elif path[0].isdigit(): 
    618622        number_type = '.' in path and float or int 
    619623        try: