[Fixed]-How to save parent objects within the form_valid

1👍

You correctly used commit=False, but then added the attributes onto the form object itself instead of the object returned from the save. It should be:

    object = form.save(commit=False)
    object.box = Box.objects.first()
    object.participant = Suggestion.objects.first()
    object.save()

Leave a comment