I have two models defined loosely like this:
class InformationUnit(models.Model): username = models.CharField(max_length=255) project = models.Foreig
If you just want to count the distinct values, you can use the distinct() and count() functions:
count = Project.objects.values('informationunit__username').distinct().count()