From 570fa5884b1d505198363f2697aac19f1b116c04 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Fri, 16 Mar 2012 12:41:28 -0500 Subject: [PATCH] made sury listify is called after table._before_* --- VERSION | 2 +- gluon/dal.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 9c10581b..61950fbc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-03-16 12:33:04) dev +Version 1.99.7 (2012-03-16 12:41:06) dev diff --git a/gluon/dal.py b/gluon/dal.py index b1c5e724..2f8325de 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7608,10 +7608,9 @@ class Set(object): def update(self, **update_fields): 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" [f(self,update_fields) for f in table._before_update] + 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) ret and [f(self,update_fields) for f in table._after_update] return ret @@ -7628,13 +7627,12 @@ class Set(object): else: new_fields[key] = value table = self.db[tablename] - fields = table._listify(new_fields,update=True) - if not fields: - raise SyntaxError, "No fields to update" if response.errors: response.updated = None else: [f(self,new_fields) for f in table._before_update] + fields = table._listify(new_fields,update=True) + if not fields: raise SyntaxError, "No fields to update" ret = self.db._adapter.update(tablename,self.query,fields) ret and [f(self,new_fields) for f in table._after_update] response.update = ret