def change_and_save(obj, update_only_changed_fields=False, save_kwargs=None, **changed_fields):
from chamber.models import SmartModel<EOL>change(obj, **changed_fields)<EOL>if update_only_changed_fields and not isinstance(obj, SmartModel):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>save_kwargs = save_kwargs if save_kwargs is not None else {}<EOL>if update_only_changed_fields:<EOL><INDENT>save_kwargs['<STR_LIT>'] = True<EOL><DEDENT>obj.save(**save_kwargs)<EOL>return obj<EOL>
Changes a given `changed_fields` on object, saves it and returns changed object.