bklukaczewski
5/9/2016 - 12:29 PM

group by with count using annotate

group by with count using annotate

Case.objects.filter(is_active=True).values('status').annotate(total=Count('status')).order_by('status')