ahserver_g/doodahs/id2file.py
2022-05-31 10:56:19 +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