diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-23 14:10:14 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-23 14:10:14 -0500 |
| commit | e9d1b5b8de35dabc42d7dcf91c01783fa3133733 (patch) | |
| tree | 66ad188d60fad5d5e268f323e408590edc65b5ae /lib/sqlalchemy/orm | |
| parent | 08ef0e21e06e0f2e90d42c22d2d98846ed62bdec (diff) | |
| download | sqlalchemy-e9d1b5b8de35dabc42d7dcf91c01783fa3133733.tar.gz | |
- added flag to mark any attribute as "modified"
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 7f722aa44..40a69d96a 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -1247,3 +1247,15 @@ def del_attribute(instance, key): state, dict_ = instance_state(instance), instance_dict(instance) state.manager[key].impl.delete(state, dict_) +def flag_modified(instance, key): + """Mark an attribute on an instance as 'modified'. + + This sets the 'modified' flag on the instance and + establishes an unconditional change event for the given attribute. + + """ + state, dict_ = instance_state(instance), instance_dict(instance) + impl = state.manager[key].impl + state.modified_event(dict_, impl, NO_VALUE) + +
\ No newline at end of file |
