mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-18 22:52:01 -04:00
09fac89deb
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