From 4f18ce0af5d634120e85fe64d56f4f9310e13457 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 2 Jan 2011 19:54:31 -0500 Subject: - add support for pickling with mutable scalars, mutable composites - add pickle/unpickle events to ORM events. these are needed for the mutable extension. - finish mutable extension documentation, consolidate examples, add full descriptions --- lib/sqlalchemy/orm/state.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/orm/state.py') diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py index da91a353e..7a93b5cb0 100644 --- a/lib/sqlalchemy/orm/state.py +++ b/lib/sqlalchemy/orm/state.py @@ -147,6 +147,9 @@ class InstanceState(object): ) if self.load_path: d['load_path'] = interfaces.serialize_path(self.load_path) + + self.manager.dispatch.pickle(self, d) + return d def __setstate__(self, state): @@ -182,7 +185,7 @@ class InstanceState(object): if 'load_path' in state: self.load_path = interfaces.deserialize_path(state['load_path']) - # TODO: need an event here, link to composite, mutable + manager.dispatch.unpickle(self, state) def initialize(self, key): """Set this attribute to an empty value or collection, -- cgit v1.2.1