marshmallow-sqlalchemy icon indicating copy to clipboard operation
marshmallow-sqlalchemy copied to clipboard

update a non-existent field in instance when updating this instance

Open beaulian opened this issue 1 year ago • 1 comments

Hi,

According to the following code, when we update an instance, whatever we define other fields (not in the Model) in the Schema, these fields will be inserted to the instance, is it a bug?

https://github.com/marshmallow-code/marshmallow-sqlalchemy/blob/d4c7479b15a00abc76011b76a6b22db2386d23e1/src/marshmallow_sqlalchemy/load_instance_mixin.py#L73-L76

Thanks

beaulian avatar Mar 24 '23 12:03 beaulian

I would say it is a bug in client code.

Should this lib actively try to catch this?

lafrech avatar Mar 24 '23 13:03 lafrech