teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

内容編集

2019/04/17 04:12

投稿

noname0001
noname0001

スコア16

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,6 @@
1
1
  ### [やりたいこと]
2
2
  Djangoのtemplate内で、forループ中にcontentから値を取得したいのですが、loop_counter0を使用してcontentのインデックスを指定したいです。
3
+ (q1、q2は別のDBテーブルです)
3
4
  ```
4
5
  ...
5
6
  {% for q1 in queryset1 %}
@@ -13,4 +14,6 @@
13
14
  下記のサイトでは、「the conclusion is that it is impossible from template side. I'd preprocess using zip function in controller」と言っていますが、やはりtemplateだけでは解決不可能でしょうか。
14
15
 
15
16
  [参考サイト]
16
- https://stackoverflow.com/questions/31602661/accessing-nested-list-by-variable-in-django-templates?noredirect=1&lq=1
17
+ https://stackoverflow.com/questions/31602661/accessing-nested-list-by-variable-in-django-templates?noredirect=1&lq=1
18
+
19
+ また、その場合どのように解決すべきでしょうか。

1

内容編集

2019/04/17 04:12

投稿

noname0001
noname0001

スコア16

title CHANGED
File without changes
body CHANGED
@@ -10,6 +10,7 @@
10
10
  ```
11
11
 
12
12
 
13
- 下記のサイトでは、「...the conclusion is that it is impossible from template side. I'd preprocess using zip function in controller」と言っていますが、やはりtemplateだけでは解決不可能でしょうか。
13
+ 下記のサイトでは、「the conclusion is that it is impossible from template side. I'd preprocess using zip function in controller」と言っていますが、やはりtemplateだけでは解決不可能でしょうか。
14
14
 
15
+ [参考サイト]
15
16
  https://stackoverflow.com/questions/31602661/accessing-nested-list-by-variable-in-django-templates?noredirect=1&lq=1