[Fixed]-Get list of occurrences + count in a model Django?

29👍

After some digging, finally found out:

Person.objects.values('optional_first_name').annotate(c=Count('optional_first_name')).order_by('-c')

Leave a comment