I have a Django model called User and would like to count how many items are within the following object.
class User(AbstractUser):
following = models.ManyToManyField("self", related_name="followers")
I have tried counting them using this line followers_num = User.following.count(), but I receive this error 'ManyToManyDescriptor' object has no attribute 'count'.
I have also tried followers_num = User.objects.all().count(), but that returns the number of users.
Does anyone know how to do this?