Annotate Method

Report a typo

We have the House model with the following fields: street, house_number:

class House(models.Model):
    house_number = models.IntegerField()
    street = models.CharField(max_length=64)

Select all the correct answers for using the Count function in this model.

# Use in test
first_query = House.objects.annotate(count=Count('house_number')) 
second_query = House.objects.values('street').annotate(count=Count('house_number'))
Select one or more options from the list
___

Create a free account to access the full topic