質問編集履歴
1
コードの誤り
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
|
49
|
+
{% for i in data %}
|
46
|
-
{{
|
50
|
+
{{i.result}}
|
47
|
-
{{
|
51
|
+
{{i.total}}
|
48
52
|
{% endfor %}
|
49
53
|
```
|
50
54
|
ですが、この結果がkey=1の物のみ取得はできているようですが、
|