擅长:python、mysql、java
<p>您可以使用点符号:</p>
<blockquote>
<p>Dot lookups can be summarized like
this: when the template system
encounters a dot in a variable name,
it tries the following lookups, in
this order:</p>
<ul>
<li>Dictionary lookup (e.g., foo["bar"])</li>
<li>Attribute lookup (e.g., foo.bar)</li>
<li>Method call (e.g., foo.bar())</li>
<li>List-index lookup (e.g., foo[2])</li>
</ul>
<p>The system uses the first lookup type
that works. It’s short-circuit logic.</p>
</blockquote>