When you perform in-place modifications in the attributes of a model, no assignment occurs and the model does not know what changes have been made. The correct way to do this is to reassign:
foo.name = foo.name.lstrip
This calls the name= method, and dirty tracking is enabled.
tadman
source share