{"height":"190","description":"\u7d50\u679c\u7684\u306b\u6b63\u89e3\u306f\u3053\u3093\u306a\u611f\u3058 from django.db.models import Count hoges = Hoge.objects.filter(fuga__regex='/mogera/[0-9]+/$').values('fuga').annotate(num_fuga=Count('fuga')).order_by('-num_fuga') [hoge['num_fuga'] for hoge in hoges] values \u631f\u307e\u306a\u3044\u5931\u6557\u30d1\u30bf\u30fc\u30f3 .values() \u631f\u307e\u306a\u3044\u3068 id \u3067 group by \u3055\u308c\u3061\u3083\u3046 print(Hoge.objects.filter(fuga_\u2026","title":" Django \u306e annotate \u306e\u96c6\u8a08\u3067 group by \u3067\u30cf\u30de\u3063\u305f\u306e\u3067\u30e1\u30e2","image_url":null,"blog_title":"\u724c\u8a9e\u5099\u5fd8\u9332 -pygo","url":"https://cortyuming.hateblo.jp/entry/2019/03/27/154507","categories":["Python","Django"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcortyuming.hateblo.jp%2Fentry%2F2019%2F03%2F27%2F154507\" title=\" Django \u306e annotate \u306e\u96c6\u8a08\u3067 group by \u3067\u30cf\u30de\u3063\u305f\u306e\u3067\u30e1\u30e2 - \u724c\u8a9e\u5099\u5fd8\u9332 -pygo\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","provider_name":"Hatena Blog","blog_url":"https://cortyuming.hateblo.jp/","provider_url":"https://hatena.blog","published":"2019-03-27 15:45:07","type":"rich","width":"100%","author_name":"CortYuming","author_url":"https://blog.hatena.ne.jp/CortYuming/"}