ahserver/doodahs/id2file.py

13 lines
262 B
Python
Raw Normal View History

2022-05-31 10:56:19 +08:00
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