.annotate уникальный отчетливый
# Count Avg Sum etc. take a distinct argument for finding unique values
p = Project.objects.all().annotate(Count('unit__name', distinct=True))
Trained Tuna