diff options
author | Amir Sadoughi <amir.sadoughi@gmail.com> | 2015-03-20 00:18:09 -0500 |
---|---|---|
committer | Amir Sadoughi <amir.sadoughi@gmail.com> | 2015-03-20 17:04:29 -0500 |
commit | 3365a4f78ed54fc0c242c01a3f58e87b1518d68d (patch) | |
tree | 21b7cd5e76adeb8452e3ae768c294993a2b28a40 /lib/sqlalchemy/orm/query.py | |
parent | 422fca43f8af1bfba0c2a2d24aa2eca7fc3bd558 (diff) | |
download | sqlalchemy-pr/164.tar.gz |
Allow kwargs to be passed through update()pr/164
This is useful to be able to pass in mysql_limit=1 from using the
ORM.
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r-- | lib/sqlalchemy/orm/query.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 36180e8d5..fb2749fa1 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -2827,7 +2827,7 @@ class Query(object): delete_op.exec_() return delete_op.rowcount - def update(self, values, synchronize_session='evaluate'): + def update(self, values, synchronize_session='evaluate', update_args=None): """Perform a bulk update query. Updates rows matched by this query in the database. @@ -2936,8 +2936,9 @@ class Query(object): """ + update_args = update_args or {} update_op = persistence.BulkUpdate.factory( - self, synchronize_session, values) + self, synchronize_session, values, update_args) update_op.exec_() return update_op.rowcount |