]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add sync_backref flag in a relationship
authorFederico Caselli <cfederico87@gmail.com>
Wed, 22 Apr 2020 21:25:57 +0000 (23:25 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 6 May 2020 18:07:16 +0000 (20:07 +0200)
commitfdfc2954420ebb83fbbdc7f2ae5aeb3742e2b167
tree4cc419e0746495b2a879bc58be420050ceb4d525
parente3254c9c2b7f3a80086442215b1abb0ba3965a8e
Add sync_backref flag in a relationship

Introduce :paramref:`_orm.relationship.sync_backref` flag in a relationship
to control if the synchronization events that mutate the in-Python
attributes are added.
This flag is implied in a ``viewonly=True`` relationship.
This supersedes the previous change #5149, that warned that ``viewonly=True``
relationship target of a back_populates or backref configuration would be
disallowed.

Fixes: #5237
Change-Id: I22c5ba28dcea22fc78a83e68e667140edffc515c
(cherry picked from commit 04c990a011db5629f1a53a8e5af2080180ac8ec3)
.gitignore
doc/build/changelog/unreleased_13/5237.rst [new file with mode: 0644]
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/orm/strategies.py
test/orm/test_relationships.py