]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Create object- and column-oriented versions of AssociationProxyInstance
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 23 Oct 2018 23:38:46 +0000 (19:38 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 26 Oct 2018 20:34:33 +0000 (16:34 -0400)
commit90574aabef36fd59841b7df7d8ac30e2030e9854
treeae94a1693474a4bbbdde26b9262fac14e8ebfbf1
parentac358a04a7b077602ac668c19c3c40389d9e77e4
Create object- and column-oriented versions of AssociationProxyInstance

The :class:`.AssociationProxy` now has standard column comparison operations
such as :meth:`.ColumnOperators.like` and
:meth:`.ColumnOperators.startswith` available when the target attribute is a
plain column - the EXISTS expression that joins to the target table is
rendered as usual, but the column expression is then use within the WHERE
criteria of the EXISTS.  Note that this alters the behavior of the
``.contains()`` method on the association proxy to make use of
:meth:`.ColumnOperators.contains` when used on a column-based attribute.

Fixes: #4351
Change-Id: I310941f4e8f778c200f8144a26a89e5364cd4dfb
doc/build/changelog/migration_13.rst
doc/build/changelog/unreleased_13/4351.rst [new file with mode: 0644]
doc/build/orm/extensions/associationproxy.rst
lib/sqlalchemy/ext/associationproxy.py
test/ext/test_associationproxy.py
test/orm/test_inspect.py