]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Annotate parentmapper in primaryjoin / secondaryjoin
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 16 Jan 2017 18:34:55 +0000 (13:34 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 16 Mar 2017 16:34:40 +0000 (12:34 -0400)
commit63a7b2d2d9402b06f9bc7745eed2d98ae9f8b11c
treeddc4a454eb22548a009eb33f90a08331cc0523d3
parent2bfe19152d49b969acdc4607bf7c33727f796f5a
Annotate parentmapper in primaryjoin / secondaryjoin

This patch applies the "parentmapper" annotation to the columns
in the primaryjoin/secondaryjoin, but more dramatically,
also removes all the "deannotate" steps that were historically
applied to the relationship primaryjoin/secondaryjoin.
These deannotation steps were left over from the initial
implementations of annotations where the behaviors were not
as reliable.

By ensuring these annotations are present,
the evaluator no longer needs to do a name-based lookup
when it sees a column that has no "parentmapper",
because it can be assured this is not a mapped column.
This fixes the issue where the expression were based on
a relationship primaryjoin but the name of a column
in the join condition didn't match the attribute name.

Change-Id: I8c1d4594116d4109fef314a87c96a24d2efa0058
Fixes: #3366
doc/build/changelog/changelog_12.rst
lib/sqlalchemy/orm/evaluator.py
lib/sqlalchemy/orm/relationships.py
test/orm/test_evaluator.py