username= params_kw.username env = request._run_ns async with get_sor_context(env, 'accounting') as sor: sql = """select d.username, c.name, a.balance from account a, subject c, users d where a.orgid = d.orgid and a.subjectid = c.id and d.username = ${username}$ """ recs = swait or.sqlExe(sql, { 'username': username, 'sort': 'username' }) return { 'status': 'ok', 'data': recs } return { 'status': 'error', 'data': { 'message': 'system error' } }