【问题标题】:How to if !something如果!某事怎么办
【发布时间】:2011-06-22 01:07:32
【问题描述】:

我刚刚学习 GAE、Python 和 Django,但我的 Django 模板有问题。我知道 Django 的 GAE 版本是 0.96,所以早于很多花哨的 {% if x == False %} 东西。

我想做的就是:

{% if NOT variable.approved %}
  This should render if the approved property is False
{% end if %}

批准的属性是我的 DataStore 中的 db.BooleanProperty(default=False, required=True)

谢谢

【问题讨论】:

  • 请按照新问题/答案页面右侧的格式化指南格式化您的代码。

标签: python django google-app-engine


【解决方案1】:

你可以做{% if not variable.approved %}。例如,1.1 documentation 对此进行了说明。

请注意,如果需要,您可以在 GAE 中安装 Django 1.2。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-29
    • 2021-11-06
    • 2021-09-13
    • 2011-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多