diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-06 18:06:02 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-06-06 18:06:02 -0400 |
commit | 28c3325c4e18d01d7e0403229b452c8fbc345b80 (patch) | |
tree | 67576681ff561bcabeae0330bcf64c214bfe29aa /lib/sqlalchemy/sql/util.py | |
parent | 768108186a48a94948a7763d0f5c4dfb3f0ce773 (diff) | |
download | sqlalchemy-28c3325c4e18d01d7e0403229b452c8fbc345b80.tar.gz |
dial back the default "flatness" a bit, it will be there for joinedload and query.join(), but if
you're dealing with aliased() or with_polymorphic() you need to say "flat=True". Just the one
flag though, "flat" implies "aliased".
Diffstat (limited to 'lib/sqlalchemy/sql/util.py')
-rw-r--r-- | lib/sqlalchemy/sql/util.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 6f4d27e1b..4422705cd 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -905,12 +905,11 @@ class ColumnAdapter(ClauseAdapter): if isinstance(c, expression.Label): c = c.label(None) - # adapt_required indicates that if we got the same column - # back which we put in (i.e. it passed through), - # it's not correct. this is used by eagerloading which - # knows that all columns and expressions need to be adapted - # to a result row, and a "passthrough" is definitely targeting - # the wrong column. + # adapt_required used by eager loading to indicate that + # we don't trust a result row column that is not translated. + # this is to prevent a column from being interpreted as that + # of the child row in a self-referential scenario, see + # inheritance/test_basic.py->EagerTargetingTest.test_adapt_stringency if self.adapt_required and c is col: return None |