If I do a query:
messages =
Recipient.objects.filter(user__system_id=user_id).values("message__id","message__subject")
and then
{"data":list(messages)}
jsonify it, I end up with:
"data" : [
{
"message__id" : "2f24d132-4321-4d63-868a-21de6fbc0d44",
"message__subject" : "And look, a new subject."
}
],
Let's assume there are lots of messages.
What's the best way rename the keys? I.e, I'd like "message__id" to be "id".
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CA%2BePoMwXBvBC2tLTY1mCWyNcJgYe6v1ybpRd16qhRYwJ8Ta%2Bcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.