Django Model Foreign Key to text
The quickest fix for you is books = list(Book.objects.values('title', 'author__name'). In the assumption that author model has name field.
There is a problem, there is a Book model and in it title is the name of the book, and author is the ForeignKey of the Author model where there is a name field.
I need to get a Python list and for this I do
books = list(Book.objects.values('title', 'author'),
but the result is a list [{'title': 'Harry Potter', 'author': 1}]. How do I make sure that the author is instead of the unit?