0
我想比較兩個數字,但我得到了以下錯誤:遇到問題做簡單的數字比較和Django
Could not parse the remainder: '{{hole.number}}' from '{{hole.number}}'
這裏是我的代碼:
{% if (hole.number - 1) > 0 %}
...
{% endif %}
hole.number是正整數,所以比較應該是有效的。
那裏的頂部是關於哲學的一個非常大的音符,你最好這樣做在你的觀點[模板文檔](https://docs.djangoproject.com/en/1.3/topics/templates/),這清楚地解釋了爲什麼這樣的事情不起作用。 –
{%如果hole.number> 1%}? :P – niklasdstrom