i use a table Bid in this table have multi fields and a field named user other hand have a Dealer table that save users in Dealer_serializer i have a bids_count serializer Method Field that return each user count in Bid table i want use annotate instead of loop over filter! to get each user how many in Bid Table. if my idea not true explain me what exactly doing annotation?
class Dealer(User):
car_exhibition = models.CharField(max_length=200, blank=True, null=True)
phone = models.CharField(max_length=11, blank=True, null=True)
city = models.ForeignKey('locations.City', blank=True, null=True)
address = models.TextField(max_length=500)
class Bid(models.Model):
auction = models.ForeignKey('Auction')
user = models.ForeignKey('users.User')
step = models.BigIntegerField()
price = models.BigIntegerField()
created_time = models.DateTimeField(auto_now=True)
models.