[問題] Django的ifequal用法

看板Python作者 (偏執狂)時間17年前 (2008/06/27 20:42), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
若我有一個變數{{type}} 當{{type}}為"dog" or "cat"時 就做某事 而ifequal的用法是不是只能判斷一個值而已? 不能同時判斷兩個值以上? 只能判斷一個值的話 寫法會變得很複雜@@"" {% ifequal type "dog" %} ... {% endifequal %} {% ifequal type "cat" %} ... {% endifequal %} 請問有好一點的方法嗎??? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 124.10.115.218
文章代碼(AID): #18PE1JP0 (Python)
文章代碼(AID): #18PE1JP0 (Python)