Created
October 28, 2021 07:58
-
-
Save TSKGunGun/2f8d12a16dc1035a5089f6d1bd6b2b46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getdata(request): | |
products = [] | |
for item in Product.objects.all: | |
product = { | |
"id" : item.id, | |
"name" : item.name | |
} | |
products.append(product) | |
dump_params = { | |
"enxure_ascii"=False | |
} | |
return JsonResponse(products, json_dumps_params=dump_params, safe=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment