summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-08-06 16:48:30 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-08-06 16:48:30 +0000
commit63519a4f0472cf2265c0b915e6d153e358a3ebdd (patch)
tree646e64f48fa65650187dc49773a826ece6a60cf1 /lib/sqlalchemy/attributes.py
parent2801ced98605b1084a6db3420ebf1cceb0d83181 (diff)
downloadsqlalchemy-63519a4f0472cf2265c0b915e6d153e358a3ebdd.tar.gz
fixed small pickle bug with lazy loaders [ticket:265]
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r--lib/sqlalchemy/attributes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py
index 724f1c807..1c4f07ac6 100644
--- a/lib/sqlalchemy/attributes.py
+++ b/lib/sqlalchemy/attributes.py
@@ -34,13 +34,13 @@ class InstrumentedAttribute(object):
def hasparent(self, item):
"""returns True if the given item is attached to a parent object
via the attribute represented by this InstrumentedAttribute."""
- return item._state.get(('hasparent', self))
+ return item._state.get(('hasparent', id(self)))
def sethasparent(self, item, value):
"""sets a boolean flag on the given item corresponding to whether or not it is
attached to a parent object via the attribute represented by this InstrumentedAttribute."""
if item is not None:
- item._state[('hasparent', self)] = value
+ item._state[('hasparent', id(self))] = value
def get_history(self, obj, passive=False):
"""return a new AttributeHistory object for the given object/this attribute's key.