From 9b2d90aa5f28503dce35d53f9c76d49eec5244b4 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 7 Oct 2013 12:51:38 -0400 Subject: [PATCH] - fix a glitch with how the default thing worked out --- lib/sqlalchemy/orm/strategy_options.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py index 2e50c3d565..0e2cf3a61c 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, ) -- 2.47.3