Apologies, I must have bumped send accidentally.

To complete the sentence, unless fields have null=True then referencing unsaved 
records here will fail because there is no id in the dependent records to 
provide a reference. By default there is a constraint that the reference is not 
null.

But rather than add null=True to fields, you probably need to ensure those 
model instances are saved and populated with a valid record before saving your 
InputTypeMap record.

It would have little to do with the database, any version. That would be the 
last place I'd go looking for such an issue.

Regards, David

On 17 Oct 2020, at 15:13, David Nugent 
<dav...@uniquode.io<mailto:dav...@uniquode.io>> wrote:

In __your__ code, most certainly.  :-)

You didn't say what 'training', 'input_type' and 'gender' are. It is in one or 
more of those where the problem exists.

Do these referenced save module instances? If they are not yet saved then it 
will trigger this error for fields where



On 13 Oct 2020, at 08:49, Joakim Hove 
<joakim.h...@gmail.com<mailto:joakim.h...@gmail.com>> wrote:

Thank you for answering. Just to be sure: you agree that the behavior I 
describe looks like a bug somewhere?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C6EE4597-0907-49BE-8E94-1BC8B9E592A0%40uniquode.io.

Reply via email to