summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorAnts Aasma <ants.aasma@gmail.com>2009-04-20 15:00:41 +0000
committerAnts Aasma <ants.aasma@gmail.com>2009-04-20 15:00:41 +0000
commit7d0c5f72f9e6bd811f741c6f553e81b4093c252f (patch)
tree7a33456f737badae9a04d21bf6500c12eb8c76e5 /lib/sqlalchemy
parent7bb91d034f2460b180381f835a487854a1d96451 (diff)
downloadsqlalchemy-7d0c5f72f9e6bd811f741c6f553e81b4093c252f.tar.gz
Query.update() and Query.delete() should turn off eagerloads. Fixes #1378.
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/query.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 9dba9edad..e8169faa2 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1549,6 +1549,8 @@ class Query(object):
if synchronize_session not in [False, 'evaluate', 'fetch']:
raise sa_exc.ArgumentError("Valid strategies for session synchronization are False, 'evaluate' and 'fetch'")
+ self = self.enable_eagerloads(False)
+
context = self._compile_context()
if len(context.statement.froms) != 1 or not isinstance(context.statement.froms[0], schema.Table):
raise sa_exc.ArgumentError("Only deletion via a single table query is currently supported")
@@ -1643,6 +1645,8 @@ class Query(object):
if synchronize_session not in [False, 'evaluate', 'expire']:
raise sa_exc.ArgumentError("Valid strategies for session synchronization are False, 'evaluate' and 'expire'")
+ self = self.enable_eagerloads(False)
+
context = self._compile_context()
if len(context.statement.froms) != 1 or not isinstance(context.statement.froms[0], schema.Table):
raise sa_exc.ArgumentError("Only update via a single table query is currently supported")