From: Mike Bayer Date: Mon, 7 Oct 2013 16:51:38 +0000 (-0400) Subject: - fix a glitch with how the default thing worked out X-Git-Tag: rel_0_9_0b1~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b2d90aa5f28503dce35d53f9c76d49eec5244b4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - fix a glitch with how the default thing worked out --- 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, )