db(...).update_naive(...) same as update but ignores table._before_update and table._after_update

This commit is contained in:
Massimo Di Pierro
2012-03-16 13:12:16 -05:00
parent 218a3e79d1
commit 3e035995f3
2 changed files with 12 additions and 1 deletions

View File

@@ -1 +1 @@
Version 1.99.7 (2012-03-16 13:01:54) dev
Version 1.99.7 (2012-03-16 13:12:00) dev

View File

@@ -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()