summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-01-31 19:57:38 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-01-31 19:57:38 -0500
commit33c7cfff6eb1b8d93dee3b4a76f4cac38c772d77 (patch)
tree9db95f480f5d7f1db1322c855f907bef6bf73e0e /lib/sqlalchemy/orm/base.py
parent6b3ecd14eae1a557cffd19da6c82d967586a6d74 (diff)
downloadsqlalchemy-33c7cfff6eb1b8d93dee3b4a76f4cac38c772d77.tar.gz
- Added a new directive used within the scope of an attribute "set" operation
to disable autoflush, in the case that the attribute needs to lazy-load the "old" value, as in when replacing one-to-one values or some kinds of many-to-one. A flush at this point otherwise occurs at the point that the attribute is None and can cause NULL violations. [ticket:2921]
Diffstat (limited to 'lib/sqlalchemy/orm/base.py')
-rw-r--r--lib/sqlalchemy/orm/base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/base.py b/lib/sqlalchemy/orm/base.py
index 577f9ff76..e973de897 100644
--- a/lib/sqlalchemy/orm/base.py
+++ b/lib/sqlalchemy/orm/base.py
@@ -80,6 +80,10 @@ LOAD_AGAINST_COMMITTED = util.symbol("LOAD_AGAINST_COMMITTED",
""", canonical=32
)
+NO_AUTOFLUSH = util.symbol("NO_AUTOFLUSH",
+"""loader callables should disable autoflush.
+""", canonical=64)
+
# pre-packaged sets of flags used as inputs
PASSIVE_OFF = util.symbol("PASSIVE_OFF",
"Callables can be emitted in all cases.",