db(...).update_naive(...) same as update but ignores table._before_update and table._after_update
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.7 (2012-03-16 13:01:54) dev
|
Version 1.99.7 (2012-03-16 13:12:00) dev
|
||||||
|
|||||||
@@ -7615,6 +7615,17 @@ class Set(object):
|
|||||||
ret and [f(self,update_fields) for f in table._after_update]
|
ret and [f(self,update_fields) for f in table._after_update]
|
||||||
return ret
|
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):
|
def validate_and_update(self, **update_fields):
|
||||||
tablename = self.db._adapter.get_table(self.query)
|
tablename = self.db._adapter.get_table(self.query)
|
||||||
response = Row()
|
response = Row()
|
||||||
|
|||||||
Reference in New Issue
Block a user