ahserver_g/doodah/id2file.py
2022-05-20 17:53:06 +08:00

13 lines
262 B
Python
Executable File

from sqlor.dbpools import runSQL
async def getFilenameFromId(idstr:str) -> str:
sql = "select * from kvobjects where id='%s'" % idstr
recs = await runSQL('homedata',sql)
if recs is None:
return None
if len(recs) == 0:
return None
return recs[0].name