summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-06-02 12:06:39 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-06-02 12:06:39 -0400
commit32716eae773e6f6b7f37baf705342c1ed89df461 (patch)
tree0f99019fc9db8cb34b9ba14c0b8469f4cb7d6cd6 /lib/sqlalchemy/orm/util.py
parent832d657854f6fca8a1925e89f0ad20d260dc9e45 (diff)
downloadsqlalchemy-32716eae773e6f6b7f37baf705342c1ed89df461.tar.gz
- blow away context._attributes
- to account for query._attributes/context.attributes, just pass the attributes dict directly to the PathRegistry methods
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r--lib/sqlalchemy/orm/util.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index ddc0dd818..bd8228f2c 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -278,16 +278,16 @@ class PathRegistry(object):
return other is not None and \
self.path == other.path
- def set(self, reg, key, value):
- reg._attributes[(key, self.path)] = value
+ def set(self, attributes, key, value):
+ attributes[(key, self.path)] = value
- def setdefault(self, reg, key, value):
- reg._attributes.setdefault((key, self.path), value)
+ def setdefault(self, attributes, key, value):
+ attributes.setdefault((key, self.path), value)
- def get(self, reg, key, value=None):
+ def get(self, attributes, key, value=None):
key = (key, self.path)
- if key in reg._attributes:
- return reg._attributes[key]
+ if key in attributes:
+ return attributes[key]
else:
return value
@@ -313,8 +313,8 @@ class PathRegistry(object):
else:
return False
- def contains(self, reg, key):
- return (key, self.path) in reg._attributes
+ def contains(self, attributes, key):
+ return (key, self.path) in attributes
def __reduce__(self):
return _unreduce_path, (self.serialize(), )
@@ -441,8 +441,8 @@ class EntityRegistry(PathRegistry, dict):
"""
path = dict.__getitem__(self, prop)
path_key = (key, path.path)
- if path_key in context._attributes:
- return context._attributes[path_key]
+ if path_key in context.attributes:
+ return context.attributes[path_key]
else:
return None