]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Raise on flag_modified() for non-present attribute
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Mar 2017 21:11:18 +0000 (17:11 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Mar 2017 21:35:12 +0000 (17:35 -0400)
commit711d29f8e4dc096f5083c075a1f64eb38e2d2e4a
treefe28b0e8f708dc6605ac19062594ff831fb95651
parentcaeb274e287f514a50524fc9fe4aeedcb3740147
Raise on flag_modified() for non-present attribute

The :func:`.attributes.flag_modified` function now raises
:class:`.InvalidRequestError` if the named attribute key is not
present within the object, as this is assumed to be present
in the flush process.  To mark an object "dirty" for a flush
without referring to any specific attribute, the
:func:`.attributes.flag_dirty` function may be used.

Change-Id: I6c64e4d253c239e38632f38c27bb16e68fe8dfbe
Fixes: #3753
doc/build/changelog/changelog_12.rst
doc/build/changelog/migration_12.rst
doc/build/orm/session_api.rst
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/state.py
test/orm/test_attributes.py