質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,7 +100,15 @@
|
|
100
100
|
|
101
101
|
context = {}
|
102
102
|
|
103
|
-
|
103
|
+
lst = [p.get_category_display for p in Post.objects.order_by('-category')]
|
104
|
+
|
105
|
+
context['all_post_category_list'] = Counter(lst)
|
106
|
+
|
107
|
+
print(Counter(lst))#追加
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
104
112
|
|
105
113
|
context['all_subpost_category_list'] = SubPost.objects.annotate(category_count=Count('category')).order_by('-category')
|
106
114
|
|