[Answer]-Overriding ModelForm.save does not update all affected fields

1👍

The transaction instance won’t get modified this way, You should call form.save() explicitly (cause the form actually contains the changed data)

transaction = Transaction.objects.get(id=id)
form = TransactionForm(request.POST, instance=transaction)
if form.is_valid():
    form.save()

You won’t create a new object, just edit the existing one, since the objects primary key is not changed

Leave a comment