fix bug in crud.py'

This commit is contained in:
yumoqing 2019-11-27 11:31:28 +08:00
parent 00884f64a4
commit 4992129e76

View File

@ -188,6 +188,8 @@ class CRUD(object):
""" """
@self.pool.runSQL @self.pool.runSQL
async def addSQL(dbname,data,**kw): async def addSQL(dbname,data,**kw):
fns = kw['fns']
vfs = kw['vfs']
sqldesc={ sqldesc={
"sql_string" : """ "sql_string" : """
insert into %s (%s) values (%s) insert into %s (%s) values (%s)
@ -209,7 +211,10 @@ class CRUD(object):
v = getID() v = getID()
data[k] = v data[k] = v
data = self.oa.execute(self.dbname+'_'+self.tablename,'beforeAdd',data) 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) data = self.oa.execute(self.dbname+'_'+self.tablename,'afterAdd',data)
return {k:data[k]} return {k:data[k]}