When annotating something to a model in Django one would write something like this:
Post.objects.all().annotate(total_yes_votes=Count('vote', filter=Q(vote__vote_choice='yes')))
What if I want to annotate on a single object and not all() the objects:
Post.objects.get(id=id).annotate(total_yes_votes=Count('vote', filter=Q(vote__vote_choice='yes')))
By the way, it doesn't work.
Isn't it more efficient to annotate a single object rather than all()?