]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow join() to pick the best candidate from multiple froms/entities
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Nov 2018 23:27:34 +0000 (18:27 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 15 Nov 2018 02:35:15 +0000 (21:35 -0500)
commit7dcfd1e019e1c0ebceba06d6684f5bf64a2efb71
tree35a6a875d1cee208b22884919359128b078eaae6
parenta698bdbc5716201804ddedde6a0fc5ab33d43300
Allow join() to pick the best candidate from multiple froms/entities

Refactored :meth:`.Query.join` to further clarify the individual components
of structuring the join. This refactor adds the ability for
:meth:`.Query.join` to determine the most appropriate "left" side of the
join when there is more than one element in the FROM list or the query is
against multiple entities.  In particular this targets the regression we
saw in :ticket:`4363` but is also of general use.   The codepaths within
:meth:`.Query.join` are now easier to follow and the error cases are
decided more specifically at an earlier point in the operation.

Fixes: #4365
Change-Id: I403f451243904a020ceab4c3f94bead550c7b2d5
doc/build/changelog/migration_13.rst
doc/build/changelog/unreleased_13/4365.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/util.py
test/orm/test_eager_relations.py
test/orm/test_joins.py