Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #13608 - Noted that template lookups use literal values.

  • Loading branch information...
commit 74c025d0285450bf277afbee095172af54562ab6 1 parent 5faadea
Tim Graham authored September 01, 2012
4  docs/ref/templates/api.txt
@@ -125,6 +125,10 @@ dot in a variable name, it tries the following lookups, in this order:
125 125
 * Attribute lookup. Example: ``foo.bar``
126 126
 * List-index lookup. Example: ``foo[bar]``
127 127
 
  128
+Note that "bar" in a template expression like ``{{ foo.bar }}`` will be
  129
+interpreted as a literal string and not using the value of the variable "bar",
  130
+if one exists in the template context.
  131
+
128 132
 The template system uses the first lookup type that works. It's short-circuit
129 133
 logic. Here are a few examples::
130 134
 
6  docs/topics/templates.txt
@@ -102,7 +102,7 @@ Use a dot (``.``) to access attributes of a variable.
102 102
     attempts to loop over a ``collections.defaultdict``::
103 103
 
104 104
         {% for k, v in defaultdict.iteritems %}
105  
-	    Do something with k and v here...
  105
+            Do something with k and v here...
106 106
         {% endfor %}
107 107
 
108 108
     Because dictionary lookup happens first, that behavior kicks in and provides
@@ -116,6 +116,10 @@ If you use a variable that doesn't exist, the template system will insert
116 116
 the value of the :setting:`TEMPLATE_STRING_IF_INVALID` setting, which is set
117 117
 to ``''`` (the empty string) by default.
118 118
 
  119
+Note that "bar" in a template expression like ``{{ foo.bar }}`` will be
  120
+interpreted as a literal string and not using the value of the variable "bar",
  121
+if one exists in the template context.
  122
+
119 123
 Filters
120 124
 =======
121 125
 

0 notes on commit 74c025d

Please sign in to comment.
Something went wrong with that request. Please try again.