阅读背景:

Django模板:如何在模板中使用模型中的字段?

来源:互联网 

In this template,

在这个模板,

<body><p>You searched for: <strong>{{ first }} {{ last }}</strong></p>

{% if lawyers %}
    <p>There are {{ lawyers|length }} schoolmates of <strong>{{ first }} {{ last }}</strong> in the database:</p>
    <ul>
        {% for lawyer in lawyers %}
        <li> {{ lawyer.first }} {{ lawyer.last }} {{ lawyer.firm_name }} {{ lawyer.school }} {{ lawyer.year_graduated }}</li>
        {% endfor %}
    </ul>

{% else %}
    <p><strong>{{ first }} {{ last }}</strong> has no classmates in the database. Try another lawyer.</p>
{% endif %} 
<body><p>You searc



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: