JsonResponse 到数组

JsonResponse to array

我使用了一个django库函数。

my_data = get_stats(request)

get_stats returns JsonResponse。

return JsonResponse({'data': response})

每个 response 对象由 'id'、'name' 和 'value' 组成。我需要将 my_data 解析为数组 - 我需要获取每个项目的 id, name and value。我怎样才能做到这一点?

JsonResponse body 在 my_data.content 如此正当

json.loads(my_data.content)