()
return jsonify({'data': _data, 'status': 1})
返回待编辑项目信息
返回待编辑项目信息
返回待编辑项目信息
def edit_project():
    """ 返回待编辑项目信息 """
    data = request.json
    pro_id = data.get('id')
    _edit = Project.get_first(id=pro_id)
    _data = {'pro_name': _edit.name,
             'user_id': _edit.user_id,
             'principal': _edit.principal,
             'func_file': json.loads(_edit.func_file),
             'host': json.loads(_edit.host),
             'host_two': json.loads(_edit.host_two),
             'host_three': json.loads(_edit.host_three),
             'host_four': json.loads(_edit.host_four),
             'headers': json.loads(_edit.headers),
             'environment_choice': _edit.environment_choice,
             'variables': json.loads(_edit.variables)}
    return jsonify({'data': _data, 'status': 1})
def edit_project ( ) : data = request . json pro_id = data . get ( 'id' ) _edit = Project . get_first ( id = pro_id ) _data = { 'pro_name' : _edit . name , 'user_id' : _edit . user_id , 'principal' : _edit . principal , 'func_file' : json . loads ( _edit . func_file ) , 'host' : json . loads ( _edit . host ) , 'host_two' : json . loads ( _edit . host_two ) , 'host_three' : json . loads ( _edit . host_three ) , 'host_four' : json . loads ( _edit . host_four ) , 'headers' : json . loads ( _edit . headers ) , 'environment_choice' : _edit . environment_choice , 'variables' : json . loads ( _edit . variables ) } return jsonify ( { 'data' : _data , 'status' : 1 } )