]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support AssociationProxy any() / has() / contains() to another AssociationProxy
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Jun 2017 16:56:04 +0000 (12:56 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Jun 2017 20:31:59 +0000 (16:31 -0400)
commit27a0bdcae0eb534dac9844e2ffa3d6bd3b1e8989
tree040448c0ac94b7d98b0f8118fe50981a23d2e5e6
parentec422fb70e0044ed42dcfda5fb1a7a65db322cf1
Support AssociationProxy any() / has() / contains() to another AssociationProxy

The :meth:`.AssociationProxy.any`, :meth:`.AssociationProxy.has`
and :meth:`.AssociationProxy.contains`
comparison methods now support linkage to an attribute that
is itself also an :class:`.AssociationProxy`, recursively.

After some initial attempts it's clear that the any() / has()
of AssociationProxy needed to be reworked into a generic
_criterion_exists() to allow this to work recursively without
excess complexity.  For the case of the multi-linked associationproxy,
the usual checks of "any()" / "has()" correctness simply don't
take place; for a single-link association proxy the error
checking logic that takes place in relationship() has been
ported to the local any() / has() methods.

Change-Id: Ic5aed2a4e910b8138a737d215430113c31cce856
Fixes: #3769
doc/build/changelog/changelog_12.rst
doc/build/changelog/migration_12.rst
lib/sqlalchemy/ext/associationproxy.py
test/ext/test_associationproxy.py