diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-25 14:08:03 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-25 14:08:03 -0500 |
| commit | 7dbb6bffc20bccb6e7087f9cfddb8463d9178204 (patch) | |
| tree | 4e99df724be8b07beb47c5740481f088ddd35450 /lib/sqlalchemy/orm/state.py | |
| parent | 9c7b00455954239dd2f8f9813fb1c024f4202ebf (diff) | |
| download | sqlalchemy-7dbb6bffc20bccb6e7087f9cfddb8463d9178204.tar.gz | |
- on_expire event, since we are starting to build off of events around
full lifecycle
- composite will use events to do everything we want it to, i.e.
storing the composite in __dict__, invalidating it on change
of any of the columns.
- will reinstate mutability of composites via callable attached
to the composite - but userland code will still need to establish
change event listening on the composite itself, perhaps via
a "mutable" mixin like the scalars.py example, perhaps via
addition of descriptors to the mutable object.
Diffstat (limited to 'lib/sqlalchemy/orm/state.py')
| -rw-r--r-- | lib/sqlalchemy/orm/state.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py index 6ec4239a3..22be5f58f 100644 --- a/lib/sqlalchemy/orm/state.py +++ b/lib/sqlalchemy/orm/state.py @@ -230,6 +230,8 @@ class InstanceState(object): self.callables[key] = self dict_.pop(key, None) + self.manager.dispatch.on_expire(self, None) + def expire_attributes(self, dict_, attribute_names): pending = self.__dict__.get('pending', None) mutable_dict = self.mutable_dict @@ -246,6 +248,8 @@ class InstanceState(object): if pending: pending.pop(key, None) + self.manager.dispatch.on_expire(self, attribute_names) + def __call__(self, passive): """__call__ allows the InstanceState to act as a deferred callable for loading expired attributes, which is also |
