bugfix
This commit is contained in:
parent
7903c00196
commit
4bd0130759
@ -14,7 +14,7 @@ class CBObject:
|
|||||||
async def handle(self,ws):
|
async def handle(self,ws):
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
async with db.sqlorContext(self.db) as sor:
|
async with db.sqlorContext(self.db) as sor:
|
||||||
delete_sql = "delete from %s" % self.tbl
|
delete_sql = "TRUNCATE TABLE %s" % self.tbl
|
||||||
await sor.sqlExe(delete_sql, {})
|
await sor.sqlExe(delete_sql, {})
|
||||||
info = await sor.I(self.tbl)
|
info = await sor.I(self.tbl)
|
||||||
for rec in getRecord(ws):
|
for rec in getRecord(ws):
|
||||||
@ -24,12 +24,6 @@ class CBObject:
|
|||||||
rec = convrec(info, rec)
|
rec = convrec(info, rec)
|
||||||
await sor.C(self.tbl, rec)
|
await sor.C(self.tbl, rec)
|
||||||
|
|
||||||
typesconv = {
|
|
||||||
"int":int,
|
|
||||||
"float":float,
|
|
||||||
"str":str,
|
|
||||||
}
|
|
||||||
|
|
||||||
def getRecord(ws):
|
def getRecord(ws):
|
||||||
names = []
|
names = []
|
||||||
types = []
|
types = []
|
||||||
@ -45,7 +39,6 @@ def getRecord(ws):
|
|||||||
else:
|
else:
|
||||||
dic = {}
|
dic = {}
|
||||||
for j,c in enumerate(r):
|
for j,c in enumerate(r):
|
||||||
# tf = typesconv.get(types[j],None)
|
|
||||||
v = c.value
|
v = c.value
|
||||||
dic[names[j]] = v
|
dic[names[j]] = v
|
||||||
yield dic
|
yield dic
|
||||||
|
Loading…
Reference in New Issue
Block a user