summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/persistence.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py
index 03d4a5457..a27c16747 100644
--- a/lib/sqlalchemy/orm/persistence.py
+++ b/lib/sqlalchemy/orm/persistence.py
@@ -806,10 +806,13 @@ class BulkUD(object):
self.context = context = query._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")
- self.primary_table = context.statement.froms[0]
+
+ self.primary_table = query._only_entity_zero(
+ "This operation requires only one Table or "
+ "entity be specified as the target."
+ ).mapper.local_table
+ else:
+ self.primary_table = context.statement.froms[0]
session = query.session