From 4992129e76712fcaac90936a829778e0a5872f67 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 27 Nov 2019 11:31:28 +0800 Subject: [PATCH] fix bug in crud.py' --- sqlor/crud.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sqlor/crud.py b/sqlor/crud.py index 1f488fe..c0676bc 100755 --- a/sqlor/crud.py +++ b/sqlor/crud.py @@ -188,6 +188,8 @@ class CRUD(object): """ @self.pool.runSQL async def addSQL(dbname,data,**kw): + fns = kw['fns'] + vfs = kw['vfs'] sqldesc={ "sql_string" : """ insert into %s (%s) values (%s) @@ -209,7 +211,10 @@ class CRUD(object): v = getID() data[k] = v data = self.oa.execute(self.dbname+'_'+self.tablename,'beforeAdd',data) - await addSQL(self.dbname,data,**kw) + kwargs = kw.copy() + kwargs['fns'] = fns + kwargs['vfs'] = vfs + await addSQL(self.dbname,data,**kwargs) data = self.oa.execute(self.dbname+'_'+self.tablename,'afterAdd',data) return {k:data[k]}