Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#15121 closed (duplicate)

ForeignKey cascading deletes fail with Integrity Error when to_field attribute set to field other than primary key

Reported by: ben.kank@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3-beta
Severity: Keywords: to_field, cascade, on_delete
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

ForeignKey cascading delete fails with Integrity Error when to_field argument set to field other than primary key. Setting the on_delete argument doesn't change this behavior either.

For example:

models.ForeignKey(Design, related_name='reports', to_field="uuid", on_delete=models.CASCADE)

Change History (2)

comment:1 by Carl Meyer, 13 years ago

Resolution: duplicate
Status: newclosed
Triage Stage: UnreviewedAccepted

This is actually a symptom of #11319. If fixing #11319 turns out to be too difficult to do before 1.3, the deletion code could potentially work around it so deletions don't fail - but that's a last resort. Marking as duplicate.

comment:2 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top