mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #13608 - Noted that template lookups use literal values.
This commit is contained in:
parent
5faadea439
commit
74c025d028
2 changed files with 9 additions and 1 deletions
|
@ -125,6 +125,10 @@ dot in a variable name, it tries the following lookups, in this order:
|
|||
* Attribute lookup. Example: ``foo.bar``
|
||||
* List-index lookup. Example: ``foo[bar]``
|
||||
|
||||
Note that "bar" in a template expression like ``{{ foo.bar }}`` will be
|
||||
interpreted as a literal string and not using the value of the variable "bar",
|
||||
if one exists in the template context.
|
||||
|
||||
The template system uses the first lookup type that works. It's short-circuit
|
||||
logic. Here are a few examples::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue