summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-08-08 01:02:16 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-08-08 01:02:16 +0000
commitaff1798c36acc814b0b27497101b0a36b9c8683c (patch)
tree939ef0cbe960f1f8ff4899163c886dfe670d7a65 /lib/sqlalchemy/attributes.py
parenta38cc03bb6e114fe846704600aaf0b4ee6023422 (diff)
downloadsqlalchemy-aff1798c36acc814b0b27497101b0a36b9c8683c.tar.gz
adjusted __getstate__ on InstrumentedList to further avoid callables getting stuck in there...
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r--lib/sqlalchemy/attributes.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py
index 1c4f07ac6..c709afe3d 100644
--- a/lib/sqlalchemy/attributes.py
+++ b/lib/sqlalchemy/attributes.py
@@ -300,14 +300,16 @@ class InstrumentedList(object):
self[:] = []
def __getstate__(self):
- """implemented to allow pickling, since __obj is a weakref."""
- return {'key':self.key, 'obj':self.obj, 'data':self.data, 'attr':self.attr}
+ """implemented to allow pickling, since __obj is a weakref, also the InstrumentedAttribute has callables
+ attached to it"""
+ return {'key':self.key, 'obj':self.obj, 'data':self.data}
def __setstate__(self, d):
- """implemented to allow pickling, since __obj is a weakref."""
+ """implemented to allow pickling, since __obj is a weakref, also the InstrumentedAttribute has callables
+ attached to it"""
self.key = d['key']
self.__obj = weakref.ref(d['obj'])
self.data = d['data']
- self.attr = d['attr']
+ self.attr = getattr(d['obj'].__class__, self.key)
obj = property(lambda s:s.__obj())