執行檢查以查看用戶是否參加。如何將上下文變量is_attending傳遞給模板而不會在'is_attending': context['is_attending']上發生語法錯誤?該檢查基本上是爲造型div和whatnot。我究竟做錯了什麼? 模板: {% for event in upcoming %}
{% registration %}
{% if is_attendi
我有這樣的模型在Django: News
Comments
Reactions
的關係是: a News has various Comments
a Comment has various Reactions
問題是用戶(在請求/會話):用戶可以訂閱反應或評論;他可能會登錄或不登錄。 (這是一個foo的例子,它並沒有多大意義) 我不能在模板做: {% for reaction in