from django.db.models import Count
categories = Result.objects.filter(event=myevent).order_by('category').values(
    'category__name').annotate(count=Count('category__name'))
Django Количество элементов в поле