I need to pass a primary key from a newly created ModelForm to another form field in the same view but I get an error. Any suggestions to make this work?
It loo
Answered - The problem arose from django not saving empty or unchanged forms. This led to null fields on those unsaved forms. Problem was fixed by allowing null fields on foreign keys, as a matter of fact -- all fields. That way, empty or unchanged forms did not return any errors on save.
FYI: Refer to @wolendranh answer.