[Answered ]-How to retrieve data of a Foreign key in django model using a single call?

2👍

You can use select_related.

books = Book.objects.filter(genre="fiction").select_related("author")

This will fetch the db only one time and auto load the author model inside the book.

Leave a comment