Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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()
 
PREVIOUS NEXT
Tagged: #convert #queryset #json #string
ADD COMMENT
Topic
Name
5+7 =