Opened 9 years ago

Last modified 6 years ago

#21295 new New feature

Add on_update support

Reported by: Anssi Kääriäinen Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: loic@…, emorley@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


There are cases where on-update cascade support would be useful. Currently Django offers no way to cascade updates.

An experimental patch implementing on_update=models.CASCADE support for foreign keys is available from: It is based on composite foreign keys branch (

I'll attach a sample project to this ticket. Unpack it, use the above mentioned branch of Django, run syncdb, runserver and try in admin. Note that the country/city names are stored locally in the models, so country name update cascades to cities and from cities to streets.

Attachments (1)

test_composite.tar.gz (6.5 KB) - added by Anssi Kääriäinen 9 years ago.
Sample project

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Anssi Kääriäinen

Attachment: test_composite.tar.gz added

Sample project

comment:1 Changed 9 years ago by Anssi Kääriäinen

Needs documentation: set
Patch needs improvement: set

comment:2 Changed 9 years ago by loic84

Cc: loic@… added

Awesome work.

I just had a brief look at the diff, it will need special handling to be compatible with migrations, my patch for #21275 addresses this issue.

comment:3 Changed 9 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:4 Changed 6 years ago by Ed Morley

Cc: emorley@… added
Note: See TracTickets for help on using tickets.
Back to Top