jsonpickle - Wrong JSON format

192 Views Asked by At

I'm trying to use jsonpickle to send an Object to front-end in JSON format. Here is the code:

#some code here...
return render(
    request,
    'template.html',
    {   
        'json_values': jsonpickle.encode(values),          
    }
)

But, when I try to echo the string generated in my javascript code I'm getting this result when I call console.log({{json_values}}):

[{'&quotid&quot: 7, &quotnovo_peso&quot: &quot13&quot}, {&quotid&quot: 13, &quotnovo_peso&quot: &quot17&quot}]

See the image below in console: enter image description here

I'm using the last Google Chrome version. Am I doing something wrong?

Thank you

0

There are 0 best solutions below