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

質問編集履歴

1

コードの誤り

2020/04/18 19:22

投稿

Mcgregor
Mcgregor

スコア31

title CHANGED
File without changes
body CHANGED
@@ -39,12 +39,16 @@
39
39
  views.py
40
40
  all = table_A.objects.all().filter(key=1).order_by('-date')[:10]
41
41
  count = all.values('result').annotate(total=Count('result'))
42
+ params = {
43
+ 'data': count,
44
+ }
45
+
42
46
  ```
43
47
  ```html
44
48
  index.html
45
- {% for result in status_result %}
49
+ {% for i in data %}
46
- {{result.status_code}}
50
+ {{i.result}}
47
- {{result.total}}
51
+ {{i.total}}
48
52
  {% endfor %}
49
53
  ```
50
54
  ですが、この結果がkey=1の物のみ取得はできているようですが、