mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #15057 - documented change in [14992]
Thanks to Tai Lee for the patch. Refs #15025, #7153 git-svn-id: http://code.djangoproject.com/svn/django/trunk@15188 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -415,9 +415,9 @@ like:
|
||||
|
||||
The template system uses dot-lookup syntax to access variable attributes. In
|
||||
the example of ``{{ poll.question }}``, first Django does a dictionary lookup
|
||||
on the object ``poll``. Failing that, it tries attribute lookup -- which works,
|
||||
in this case. If attribute lookup had failed, it would've tried calling the
|
||||
method ``question()`` on the poll object.
|
||||
on the object ``poll``. Failing that, it tries an attribute lookup -- which
|
||||
works, in this case. If attribute lookup had failed, it would've tried a
|
||||
list-index lookup.
|
||||
|
||||
Method-calling happens in the ``{% for %}`` loop: ``poll.choice_set.all`` is
|
||||
interpreted as the Python code ``poll.choice_set.all()``, which returns an
|
||||
|
||||
Reference in New Issue
Block a user