]> 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>
Tue, 5 May 2020 17:52:53 +0000 (19:52 +0200)
commit04c990a011db5629f1a53a8e5af2080180ac8ec3
treecb3f6c76e79ef1588ca650bb81eed85768dce61d
parent7acf9af1ce74a0bda4c4d29af7da543b5c42b3f8
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
.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