ns = params_kw.copy() for k,v in list(ns.items()): if v == 'NaN' or v == 'null': ns[k] = None if k.endswith('_text'): ns.pop(k, None) if not ns.get('id'): return {'widgettype':'Error','options':{'title':'Error','message':'missing id','cwidth':16,'cheight':9,'timeout':3}} ns['updated_at'] = datetime.datetime.now().isoformat() db = DBPools() dbname = get_module_dbname('pcpool') async with db.sqlorContext(dbname) as sor: await sor.U('compute_pool', ns) return {'widgettype':'Message','options':{'cwidth':16,'cheight':9,'title':'Success','timeout':3,'message':'ok'}}