Django

Code

Changeset 1347

Show
Ignore:
Timestamp:
11/21/05 23:11:14 (3 years ago)
Author:
adrian
Message:

Tiny logic tightening in core.template.loader -- taken from new-admin

Files:

Legend:

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

    r872 r1347  
    187187    This tag may be used in two ways: ``{% extends "base" %}`` (with quotes) 
    188188    uses the literal value "base" as the name of the parent template to extend, 
    189     or ``{% entends variable %}`` uses the value of ``variable`` as the name 
     189    or ``{% extends variable %}`` uses the value of ``variable`` as the name 
    190190    of the parent template to extend. 
    191191    """ 
     
    194194        raise TemplateSyntaxError, "'%s' takes one argument" % bits[0] 
    195195    parent_name, parent_name_var = None, None 
    196     if (bits[1].startswith('"') and bits[1].endswith('"')) or (bits[1].startswith("'") and bits[1].endswith("'"))
     196    if bits[1][0] in ('"', "'") and bits[1][-1] == bits[1][0]
    197197        parent_name = bits[1][1:-1] 
    198198    else: