ns = params_kw.copy() for k,v in ns.items(): if v == 'NaN' or v == 'null': ns[k] = None id = params_kw.id if not id or len(id) > 32: id = uuid() ns['id'] = id db = DBPools() dbname = get_module_dbname('uapi') async with db.sqlorContext(dbname) as sor: r = await sor.C('uapiio', ns.copy()) return { "widgettype":"Message", "options":{ "cwidth":16, "cheight":9, "title":"Add Success", "timeout":3, "message":"ok" } } return { "widgettype":"Error", "options":{ "title":"Add Error", "cwidth":16, "cheight":9, "timeout":3, "message":"failed" } }