summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-10-07 12:51:38 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-10-07 12:51:38 -0400
commit9b2d90aa5f28503dce35d53f9c76d49eec5244b4 (patch)
treee584b9ef2f2d41d2ded257c73d65bc5aebc8246b /lib/sqlalchemy
parentd91449361654385edde382776e0dc5639047a1a8 (diff)
downloadsqlalchemy-9b2d90aa5f28503dce35d53f9c76d49eec5244b4.tar.gz
- fix a glitch with how the default thing worked out
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/strategy_options.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py
index 2e50c3d56..0e2cf3a61 100644
--- a/lib/sqlalchemy/orm/strategy_options.py
+++ b/lib/sqlalchemy/orm/strategy_options.py
@@ -114,11 +114,12 @@ class Load(Generative, MapperOption):
)
if isinstance(attr, util.string_types):
- if attr.endswith(_WILDCARD_TOKEN) or attr.endswith(_DEFAULT_TOKEN):
+ default_token = attr.endswith(_DEFAULT_TOKEN)
+ if attr.endswith(_WILDCARD_TOKEN) or default_token:
+ if default_token:
+ self.propagate_to_loaders = False
if wildcard_key:
attr = "%s:%s" % (wildcard_key, attr)
- if attr.endswith(_DEFAULT_TOKEN):
- self.propagate_to_loaders = False
return path.token(attr)
try:
@@ -256,9 +257,9 @@ class _UnboundLoad(Load):
def _generate_path(self, path, attr, wildcard_key):
if wildcard_key and isinstance(attr, util.string_types) and \
attr in (_WILDCARD_TOKEN, _DEFAULT_TOKEN):
- attr = "%s:%s" % (wildcard_key, attr)
if attr == _DEFAULT_TOKEN:
self.propagate_to_loaders = False
+ attr = "%s:%s" % (wildcard_key, attr)
return path + (attr, )