return json value as char/text instead of json

5 views
Skip to first unread message

Campbell McKilligan

unread,
Jun 30, 2021, 4:23:04 PM6/30/21
to Django users
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
Reply all
Reply to author
Forward
0 new messages