django model data export to json code example
Example: 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()
# Simply wrap the queryset in a list
data = list(queryset.values())
# Hint: need to use .values() not .all()