[Django]-How to get a related objects queryset through multiple levels of reverse foreignkeys in django?

5👍

The most efficient way to reduce number of database queries will be to filter on the queryset of Articles.

# pub is the instance of Publisher
articles = Article.objects.filter(author__publisher=pub)

Leave a comment