Re: [問題] django inlucde tag 參數問題

看板Python作者 (←這人是超級笨蛋)時間11年前 (2014/04/05 22:36), 編輯推噓2(201)
留言3則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《qoorocker (rockers)》之銘言: : 目前我在處理 template 中 include 時所需傳入的參數 : {% include "form.html" with action={% url "blog:create_comment" %} only %} : 似乎沒辦法處理 inlcude tag 似乎沒辦法優先處理完 url tag導致出錯 : 錯誤訊息 : Could not parse the remainder: '{%' from '{%' : 好像沒辦法 tag 中 再加 tag, 不知道大家是怎麼處理的 確實不行, 這種狀況通常是用 url ... as 來處理 https://docs.djangoproject.com/en/dev/ref/templates/builtins/#url {% url 'blog:create_comment' as action_url %} {% include 'form.html' with action=action_url only %} -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.161.94.175 ※ 文章網址: http://www.ptt.cc/bbs/Python/M.1396708616.A.58F.html

04/06 17:21, , 1F
成功了!~ 感謝你 救星阿~~~ 號其在問問
04/06 17:21, 1F

04/06 17:22, , 2F
permission 這方面你們是怎麼控制的?
04/06 17:22, 2F

04/06 17:29, , 3F
另外開文討論吧
04/06 17:29, 3F
文章代碼(AID): #1JG1K8MF (Python)
討論串 (同標題文章)
文章代碼(AID): #1JG1K8MF (Python)