diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-15 09:45:48 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-15 11:24:05 -0500 |
commit | 09fac89debfbdcccbf2bcc433f7bec7921cf62be (patch) | |
tree | b3b5b0c4f0e0e38e0914c8dd68086f226fcfd632 /lib/sqlalchemy/sql/lambdas.py | |
parent | e8ff0af840eb7fae11ef9234ae2bf1e16a9b634e (diff) | |
download | sqlalchemy-09fac89debfbdcccbf2bcc433f7bec7921cf62be.tar.gz |
Check explicitly for mapped class as secondary
Added a comprehensive check and an informative error message for the case
where a mapped class, or a string mapped class name, is passed to
:paramref:`_orm.relationship.secondary`. This is an extremely common error
which warrants a clear message.
Additionally, added a new rule to the class registry resolution such that
with regards to the :paramref:`_orm.relationship.secondary` parameter, if a
mapped class and its table are of the identical string name, the
:class:`.Table` will be favored when resolving this parameter. In all
other cases, the class continues to be favored if a class and table
share the identical name.
Fixes: #5774
Change-Id: I65069d79c1c3897fbd1081a8e1edf3b63b497223
Diffstat (limited to 'lib/sqlalchemy/sql/lambdas.py')
0 files changed, 0 insertions, 0 deletions