Django Book 翻译
菜单>:
TOC
返回
原文:
The Django template system deliberately is not a full-fledged programming language and thus does not allow you to execute arbitrary Python statements. (More on this idea in the section Philosophies and Limitations.) However, its quite a common template requirement to compare two values and display something if theyre equaland Django provides an ``{% ifequal %}`` tag for that purpose.
翻译:
Django模板系统压根儿就没想过实现一个全功能的编程语言,所以它不允许我们在模板中执行Python的语句(还是那句话,要了解更多请参看理念和限制小节)。但是比较两个变量的值并且显示一些结果实在是个太常见的需求了,所以Django提供了 ``{% ifequal %}`` 标签供我们使用。
备注:
译者: