I am trying to annotate a count of how many times a Location (a Location model) is followed (a Follow model, using Django Follow), for those Locations that the user is following (hence the filter at the end).
Here is the offending line of code:
following_locations = Follow.objects.annotate(followers_count=Count('target_location__id')).filter(user=user)
But, the resulting followers_count only ever gives me a count of 1 for each item in following_locations (when I loop through it in the template).
Seems simple enough, but not sure where I am going wrong?