Opened 12 months ago

Last modified 11 months ago

#29112 assigned New feature

Make it easier to update specific keys within nested Django JSONField data.

Reported by: Michael Owned by: Priyansh Saxena
Component: contrib.postgres Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: yes


Django's docs have a great example of querying nested data using double underscore syntax similar to querying across foreign keys


What if we wanted to update this dogs owner's name instead (without touching anything else)? Rather than doing this

dog = Dog.objects.get(pk=n)
data =
data['owner']['name'] = 'Steve' = data

It would be great to do this:


Looks like django-postgres-extensions[0] attempts to do this, but I found the library to be unstable on 1.11.

[0] -

Change History (4)

comment:1 Changed 12 months ago by Simon Charette

Triage Stage: UnreviewedAccepted
Version: 1.11master

This is kind of related to #24709 but for JSONField instead of ArrayField.

comment:2 Changed 11 months ago by Priyansh Saxena

Owner: set to Priyansh Saxena
Status: newassigned

comment:3 Changed 11 months ago by Priyansh Saxena

Has patch: set

comment:4 Changed 11 months ago by Tim Graham

Patch needs improvement: set
Note: See TracTickets for help on using tickets.
Back to Top