]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Handle association proxy delete and provide for scalar delete cascade
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 1 Aug 2018 16:01:59 +0000 (12:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 1 Aug 2018 22:06:48 +0000 (18:06 -0400)
commit19cd4d4bc01d6176a23c72d37634c8ee4acbac40
tree2b799e9a421e18590101e1d2961f35d8c1f63137
parent1c32206120b1a6555f8bb7a20a0c4c53ea2f52a8
Handle association proxy delete and provide for scalar delete cascade

Fixed multiple issues regarding de-association of scalar objects with the
association proxy.  ``del`` now works, and additionally a new flag
:paramref:`.AssociationProxy.cascade_scalar_deletes` is added, which when
set to True indicates that setting a scalar attribute to ``None`` or
deleting via ``del`` will also set the source association to ``None``.

Change-Id: I1580d761571d63eb03a7e8df078cef97d265b85c
Fixes: #4308
doc/build/changelog/migration_13.rst
doc/build/changelog/unreleased_13/4308.rst [new file with mode: 0644]
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/orm/attributes.py
test/ext/test_associationproxy.py
test/orm/test_attributes.py