Opened 11 years ago
Closed 11 years ago
#21265 closed Uncategorized (wontfix)
on_update foreign key
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.5 |
Severity: | Normal | Keywords: | on_dalete, foreignkey |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When i use custom primary key and i change value of it, my foreign keys can't be updates, there is no on_update cascade option?
I use postgres db.
Change History (3)
comment:1 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 11 years ago
Resolution: | wontfix |
---|---|
Status: | closed → new |
I did manualy that and its working on db level, but when edit in django i get "list index out of range" ?
comment:3 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Sorry, this isn't a support channel. Try to ask for help at #django IRC channel or django-users mailing list.
Note:
See TracTickets
for help on using tickets.
No, there is currently no on_update functionality. In addition, it is unlikely that Django will ever officially support cascades for foreign keys targeting updatable primary keys. It is somewhat likely that updatable primary keys will be documented as unsupported.
I am marking this as wontfix. This resolution is specifically about on_update for foreign keys targeting primary key values. I do support adding on_update support to foreign keys targeting other fields than the model's primary key.
As a workaround you can manually alter the database constraints to be "ON UPDATE CASCADE".