Closed martsberger closed 10 years ago
It should be possible to do a query like this:
publishers = Publisher.objects.annotate(jeff_books=Count('book', only=Q(book__contact__name__icontains='Jeff')))
This generates an error because the author table is not joined to. In this pull request, the only clause explicitly generates the necessary joins so that the above query will work.
only
Test included.
That's pretty awesome! Thank you! I'll make a new release soon with your patch.
It should be possible to do a query like this:
This generates an error because the author table is not joined to. In this pull request, the
only
clause explicitly generates the necessary joins so that the above query will work.Test included.