[Answered ]-Can I set the instance of the ModelForm after I call is_valid?

2👍

If your form is overwriting all the information in the instance, you could simply set the primary key manually:

if form.is_valid():
    obj = form.save(commit=False)
    obj.pk = form.cleaned_data['pk_to_edit']
    obj.save()
    return ...

Leave a comment