primary key, foreign key combination

25 views
Skip to first unread message

dsfqce cwfe

unread,
Jan 30, 2017, 1:24:21 PM1/30/17
to Django users
When I try to update_or_create model object with primary key that is also a foreign key in some other model I get DoesNotExist error and then IntegrityError duplicate entry error. My way around this is to try get the object and then update it without the primary key or create it (with primary key of course) on exception. Is it a bug or am i doing something wrong?
Reply all
Reply to author
Forward
0 new messages