Answers for "how to convert a queryset into json string"

2

how to convert a queryset into json string

# Simply wrap the queryset in a list

data = list(queryset.values())

# Hint: need to use .values() not .all()
Posted by: Guest on July-18-2020

Code answers related to "how to convert a queryset into json string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language