def update(self,req,body,id=None): environ = req.environ user_id = environ['HTTP_X_USER_ID'] user_name = environ['HTTP_X_USER_NAME'] user_role = environ['HTTP_X_ROLES'] self.db_session=environ['db_session'] #修改sv_arg_type_tb表 input_arg_types=body.pop('input_arg_types') for key in input_arg_types.keys(): db.updateSvArgtype(self.db_session,key,input_arg_types['key']) output_arg_types=body.pop('output_arg_types') for key in output_arg_types.keys(): db.updateSvArgtype(self.db_session, key, input_arg_types['key']) #修改sv_tb表 db.updateSvTB(self.db_session, id, body)
def update(self, req, body, id=None): environ = req.environ user_id = environ['HTTP_X_USER_ID'] user_name = environ['HTTP_X_USER_NAME'] user_role = environ['HTTP_X_ROLES'] self.db_session = environ['db_session'] #修改sv_arg_type_tb表 input_arg_types = body.pop('input_arg_types') for key in input_arg_types.keys(): db.updateSvArgtype(self.db_session, key, input_arg_types['key']) output_arg_types = body.pop('output_arg_types') for key in output_arg_types.keys(): db.updateSvArgtype(self.db_session, key, input_arg_types['key']) #修改sv_tb表 db.updateSvTB(self.db_session, id, body)
except Exception,e: return e.msg #修改sv_arg_type_tb表 print body print "#####################" print body['input_arg_types'] input_arg_types=body.pop('input_arg_types') for key in input_arg_types.keys(): db.updateSvArgtype(self.db_session,key,input_arg_types[key]) output_arg_types=body.pop('output_arg_types') for key in output_arg_types.keys(): db.updateSvArgtype(self.db_session, key, output_arg_types[key]) print "#####################" print body #修改sv_tb表 db.updateSvTB(self.db_session, id, body) return 'update successfully!!!' class ArgTypeMan(): def __init__(self): self.db_session=None def index(self,req): environ = req.environ self.db_session=environ['db_session'] #利用db查询数据库,并以json格式返回 arts_data = db.getArgTypeInfo(self.db_session) arts={} arts['ats'] = arts_data return arts