[やりたいこと]
Djangoのtemplate内で、forループ中にcontentから値を取得したいのですが、loop_counter0を使用してcontentのインデックスを指定したいです。
(q1、q2は別のDBテーブルです)
... {% for q1 in queryset1 %} <tr> <td>{{ q1.id }}</td> <td>{{ q2.{{ loop_counter0 }}.text }}</td> ...
下記のサイトでは、「the conclusion is that it is impossible from template side. I'd preprocess using zip function in controller」と言っていますが、やはりtemplateだけでは解決不可能でしょうか。
また、その場合どのように解決すべきでしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。