Wednesday, June 30, 2021

return json value as char/text instead of json

I'm using Concat of some annotated json fields (from .values("data__somefield", "data__someotherfield")

The values are being returned as json, so the concatenation ends up with a hot mess of double quotes:
"somevalue" "someothervalue"
 
I can see in the query that Django is using the "->" operator to retrieve the value from the json which explains the double quotes.

Is there a way to encourage Django to retrieve as text (ie with the "->>" operator) - to prevent the double quotations?

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54dd60b9-0c19-469d-b3da-50ffdf2ed427n%40googlegroups.com.

No comments:

Post a Comment