def count_votes(self): """ Returns questions annotated with the number of votes they have. """ return self.annotate(num_votes=Coalesce(models.Sum('votes__vote'), 0))