Why not provide update fields in updateview?

It is not relevant in createview, but i want to update fields whne updating an object.

i checked force insert and force update are passed as false, and using and update fields are passed as none.

I want to convert data only for changed fields and save only those fields.
Why isn’t this supported in updateview?

It is. Or more accurately, it can be.

The UpdateView.form_valid method calls form.save(). You can override .save() in your form for whatever behavior is desired.

However, as a general principle in the environment of a web-based application, doing this is dangerous - it’s subject to a race condition regarding concurrent edits. (See the comment at Automatically setting update_fields when saving a model instance - #3 by megaman821)

I think you should carefully evaluate whether this is something you need to do, or if it just seems like a good idea.

I wasn’t asking if it was possible to fix it, I was asking “why” the code was written that way.

Fundamentally, you’re looking in the wrong location for that support.

The UpdateView doesn’t save the data, that function is performed by the Form class. The .save() method doesn’t accept any parameters, so it’s not like the view can even supply that information in the call.

So the only place that it can appropriately be done is in the form. Note that this isn’t standard for forms, either, so it would require a custom form to do this.

Are you one of Django’s developers?