From 00884f64a4879c33c3b5b283df54dcf2ea77ce85 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 23 Oct 2019 16:32:18 +0800 Subject: [PATCH] bugfix --- sqlor/crud.py | 8 -------- sqlor/dbpools.py | 10 ---------- 2 files changed, 18 deletions(-) diff --git a/sqlor/crud.py b/sqlor/crud.py index d4074ba..1f488fe 100755 --- a/sqlor/crud.py +++ b/sqlor/crud.py @@ -259,9 +259,7 @@ class CRUD(object): @self.pool.inSqlor async def main(dbname,NS,**kw): - print('here2') p = await self.primaryKey(**kw) - print('here3') if NS.get('__id') is not None: NS[p[0]['field_name']] = NS['__id'] del NS['__id'] @@ -274,18 +272,12 @@ class CRUD(object): data = self.oa.execute(self.dbname+'_'+self.tablename,'beforeRetrieve',NS) if NS.get('page'): - print('here4') data = await pagingdata(self.dbname,data,**kw) - print('here5') else: - print('here6') data = await retrieve(self.dbname,data,**kw) - print('here7') data = self.oa.execute(self.dbname+'_'+self.tablename,'afterRetrieve',data) - print('here8') return data - print('here1') return await main(self.dbname,NS,**kw) async def U(self,data, **kw): diff --git a/sqlor/dbpools.py b/sqlor/dbpools.py index 1338a9b..0c43ee1 100644 --- a/sqlor/dbpools.py +++ b/sqlor/dbpools.py @@ -259,29 +259,20 @@ class DBPools: def runSQL(self,func): @wraps(func) async def wrap_func(dbname,NS,*args,**kw): - print('runSQL:1') sor, commit = await self.useOrGetSor(dbname,**kw) - print('runSQL:2') kw['sor'] = sor ret = None try: - print('runSQL:3') desc = await func(dbname,NS,*args,**kw) - print('runSQL:4') callback = kw.get('callback',None) kw1 = {} [ kw1.update({k:v}) for k,v in kw.items() if k!='callback' ] - print('runSQL:5') ret = await sor.runSQL(desc,NS,callback,**kw1) - print('runSQL:6') if commit: try: - print('runSQL:7') await sor.conn.commit() - print('runSQL:8') except: pass - print('runSQL:9') if NS.get('dummy'): return NS['dummy'] else: @@ -297,7 +288,6 @@ class DBPools: raise e finally: if commit: - print('runSQL:10') await self.freeSqlor(sor) return wrap_func