【问题标题】:Python Google App Engine If [duplicate]Python Google App Engine 如果 [重复]
【发布时间】:2016-10-06 16:54:01
【问题描述】:

嘿,我是 Python 和 Python 模板以及 Google App Engine 的新手,如果存在错误,我正在尝试显示带有错误的卡片。

        {% if {{error}}!="" %}
        <div class="row center-align">
            <div class="col s12 m6 l6 center-align">
                <div class="card red lighten-1">
                    <div class="card-content white-text">
                        <p>{{error}}</p>
                    </div>
                </div>
            </div>
        </div>
        {% endif %}

这似乎是这样做的逻辑方式,但我遇到了错误。关于如何做到这一点的任何想法?

【问题讨论】:

标签: python google-app-engine templates


【解决方案1】:

当您已经在模板标签中时,您不需要变量标签。

{% if error != '' %}

或者只是

{% if error %}

【讨论】:

    猜你喜欢
    • 2012-12-20
    • 2016-07-13
    • 2021-04-30
    • 2023-04-04
    • 2011-05-28
    • 2018-01-14
    • 1970-01-01
    • 1970-01-01
    • 2011-05-12
    相关资源
    最近更新 更多