]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Refine ambiguous access for unknown attribute types
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 26 Mar 2019 16:58:42 +0000 (12:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 26 Mar 2019 19:17:48 +0000 (15:17 -0400)
commit51f81d00dc6103c1dea939513a3437a5ab433e75
tree5a140a115a5317b827ce34f60506b15b99f4e886
parent8acbc2624fb4b457e47fab93e6a44a1e37caeddc
Refine ambiguous access for unknown attribute types

Restored instance-level support for plain Python descriptors, e.g.
``@property`` objects, in conjunction with association proxies, in that if
the proxied object is not within ORM scope at all, it gets classified as
"ambiguous" but is proxed directly.  For class level access, a basic class
level``__get__()`` now returns the
:class:`.AmbiguousAssociationProxyInstance` directly, rather than raising
its exception, which is the closest approximation to the previous behavior
that returned the :class:`.AssociationProxy` itself that's possible.  Also
improved the stringification of these objects to be more descriptive of
current state.

Fixes: #4574
Change-Id: I787a22806b5530c146ae6ee66b588e5b191ae689
doc/build/changelog/unreleased_13/4574.rst [new file with mode: 0644]
lib/sqlalchemy/ext/associationproxy.py
test/ext/test_associationproxy.py