[Answered ]-Django format a request in a list

1👍

You can work with .values_list(…) [Django-doc]:

Book.objects.filter(author='Hergé').values_list('name', flat=True)

But usually it is not a good idea to use .values(…) or .values_list(…) to retrieve data, not even to serialize: it erodes the model layer, and thus will prevent fetching related objects, obtaining the display name, etc.

Leave a comment