diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-13 21:40:02 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-13 21:40:02 +0000 |
commit | f2974ef3993e02646a2dfade5feb74afb78f370f (patch) | |
tree | 2c6aaeee13744eec8ee0d86d44bf75e8b8c83811 /lib/sqlalchemy/orm/query.py | |
parent | aedcd6aea6aa3b4601bbc26f5fc23c084c8996ac (diff) | |
download | sqlalchemy-f2974ef3993e02646a2dfade5feb74afb78f370f.tar.gz |
- Documentation clarification for query.delete()
[ticket:1689]
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r-- | lib/sqlalchemy/orm/query.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 456f1f19c..bd5a08987 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1682,7 +1682,8 @@ class Query(object): 'evaluate' - Evaluate the query's criteria in Python straight on the objects in the session. If evaluation of the criteria isn't - implemented, the 'fetch' strategy will be used as a fallback. + implemented, an error is raised. In that case you probably + want to use the 'fetch' strategy as a fallback. The expression evaluator currently doesn't account for differing string collations between the database and Python. @@ -1707,14 +1708,17 @@ class Query(object): #TODO: cascades need handling. if synchronize_session not in [False, 'evaluate', 'fetch']: - raise sa_exc.ArgumentError("Valid strategies for session synchronization are False, 'evaluate' and 'fetch'") + raise sa_exc.ArgumentError("Valid strategies for session " + "synchronization are False, 'evaluate' and 'fetch'") self._no_select_modifiers("delete") 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") + 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") primary_table = context.statement.froms[0] session = self.session |