Re: get id to be used in a foreign key with two model forms

2010-12-23 Thread Michael Thamm
For those of you that are having the same issue with saving related data in a model form here is how I solved it. The issue is that I needed to save my form and then point to the saved record in the related record before committing the related record. I'm surprised django doesn't handle this

get id to be used in a foreign key with two model forms

2010-12-22 Thread Michael Thamm
Hi, I am using 2 model forms and when I save the I get a save error since the foreign key field can't be blank. I try to add the new id at save, but it doesn't work. This is the code for the save. temp=shirtForm.save(commit=False) userForm.shirt=temp.id userForm.save()