[Django]-Cannot convert Django Queryset to a List

10👍

If you want a list, you should use values_list.

my_books = Book.objects.values_list('title', flat=True) 

The flat=True parameter makes it a flat list, rather than a list of lists.

Leave a comment