From 3e035995f344bbba816fc344c8a8dca46243bf64 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Fri, 16 Mar 2012 13:12:16 -0500 Subject: [PATCH] db(...).update_naive(...) same as update but ignores table._before_update and table._after_update --- VERSION | 2 +- gluon/dal.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 06711b2c..cee18a2e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-03-16 13:01:54) dev +Version 1.99.7 (2012-03-16 13:12:00) dev diff --git a/gluon/dal.py b/gluon/dal.py index 3e9d47f3..12b3aa37 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7615,6 +7615,17 @@ class Set(object): ret and [f(self,update_fields) for f in table._after_update] return ret + def update_naive(self, **update_fields): + """ + same as update but does not call table._before_update and _after_update + """ + tablename = self.db._adapter.get_table(self.query) + table = self.db[tablename] + fields = table._listify(update_fields,update=True) + if not fields: raise SyntaxError, "No fields to update" + ret = self.db._adapter.update(tablename,self.query,fields) + return ret + def validate_and_update(self, **update_fields): tablename = self.db._adapter.get_table(self.query) response = Row()