Opened 6 years ago

Last modified 14 months ago

#23268 assigned Bug

Fixtures: Natural Key support for Generic Foreign Keys

Reported by: Anshuman Aggarwal Owned by: Guillaume Thomas
Component: Core (Serialization) Version: 1.6
Severity: Normal Keywords: natural generic fixtures
Cc: dev@…, Ian Foote Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


Currently, the natural key support is incomplete when it comes to generic foreign keys (I say bug, you may think feature). One cannot remove PKs from any object that has a generic foreign key reference limiting the whole idea of having natural keys to direct foreign keys only. Since generic foreign keys can inherently have an entry with any model, PKs have to be dumped for all models necessitating the maintenance of updated PKs

There is a great answer by someone who has done the leg work for figuring out what is required.

Creating a ticket to document it here and see what the interest is for the same.

Change History (7)

comment:1 Changed 6 years ago by Brillgen Developers

Cc: dev@… added

comment:2 Changed 6 years ago by Aymeric Augustin

Triage Stage: UnreviewedAccepted

comment:3 Changed 3 years ago by Guillaume Thomas

Owner: changed from nobody to Guillaume Thomas
Status: newassigned

comment:4 Changed 3 years ago by Guillaume Thomas

Has patch: set
Triage Stage: AcceptedReady for checkin
Last edited 3 years ago by Tim Graham (previous) (diff)

comment:5 Changed 3 years ago by Tim Graham

Triage Stage: Ready for checkinAccepted

"Ready for checkin" is set by a patch reviewer, not the patch author.

comment:6 Changed 3 years ago by Tim Graham

Patch needs improvement: set

As I mentioned on the pull request, it doesn't seem like a good separation of concerns to modify the "core" serializers for a "contrib" field. Unfortunately, I haven't studied the problem enough to suggest an alternate solution.

comment:7 Changed 14 months ago by Ian Foote

Cc: Ian Foote added
Note: See TracTickets for help on using tickets.
Back to Top