]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
warn when backref will replace existing userland descriptor
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 14 Dec 2022 18:49:11 +0000 (13:49 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 14 Dec 2022 20:38:32 +0000 (15:38 -0500)
commit2bac535f506dd68595d64d6cdf21e2d4937c2c9f
tree7e05f77fa8fccbd63c2d1488278af6e5f56c325d
parenta8d76cff39dbaf6354d42d35cd68332df469d124
warn when backref will replace existing userland descriptor

A warning is emitted if a backref name used in :func:`_orm.relationship`
names an attribute on the target class which already has a method or
attribute assigned to that name, as the backref declaration will replace
that attribute.

Fixes: #4629
Change-Id: I0059b35ce60f43b0f3d8be008f12411154484ea1
doc/build/changelog/unreleased_20/4629.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/relationships.py
test/orm/inheritance/test_concrete.py
test/orm/test_mapper.py