4
有沒有比較Jinja中兩個日期的具體方法?如何比較Jinja2中的兩個日期?
我已經google搜索,但發現接近沒有任何與這個具體問題有關。
我已經找到最接近的事是這樣的,從官方的Jinja2文檔:
It is also possible to sort by an attribute (for example to sort by the date of an object) by specifying the attribute parameter:
{% for item in iterable|sort(attribute='date') %}
...
{% endfor %}
你應該能夠比較它們,就像你在Python中的'set','if'塊一樣 – adarsh 2014-11-06 13:37:35
你想排序一個列表或創建一個if語句嗎? – 2015-09-08 22:38:59