[Fixed]-Automatically including the foreign key within the second form

1👍

You should have posted your form. But I think this is what you want:

if form_1.is_valid() and form_2.is_valid():
    review = form_1.save()
    photo = form_2.save(commit=False)
    photo.review_comments = review
    photo.save()

Also consider using more descriptive names than form_1 and form_2.

Leave a comment