📅  最后修改于: 2022-03-11 14:46:46.532000             🧑  作者: Mango
print([v for v in
Request.objects.annotate(month=ExtractMonth('date_creation'),
year=ExtractYear('date_creation'),)
.order_by()
.values('month', 'year')
.annotate(total=Count('*'))
.values('month', 'year', 'total')
])