]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
warn for other mapper property objects assigned twice
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 14 Jun 2023 14:51:43 +0000 (10:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 15 Jun 2023 12:49:25 +0000 (08:49 -0400)
commitef327adcde54ffe19a40c7bf712b35184a696923
tree273e9ffc2d9b8587e502ef32bf2337e2573bc9b8
parente99fc16fbdf200613088268929b638978213900f
warn for other mapper property objects assigned twice

was already in place for columns via other means

A warning is emitted when an ORM :func:`_orm.relationship` and other
:class:`.MapperProperty` objects are assigned to two different class
attributes at once; only one of the attributes will be mapped.  A warning
for this condition was already in place for :class:`_schema.Column` and
:class:`_orm.mapped_column` objects.

Fixes: #3532
Change-Id: Ib8057bdf229aa92137f9b8f61b26d4008181ead6
doc/build/changelog/unreleased_20/3532.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
test/orm/declarative/test_basic.py