()
return jsonify({'msg': '删除成功', 'status': 1})
删除模块
删除模块
删除模块
def del_model():
    """ 删除模块 """
    data = request.json
    ids = data.get('id')
    _edit = Module.get_first(id=ids)
    if current_user.id != Project.query.filter_by(id=_edit.project_id).first().user_id:
        return jsonify({'msg': '不能删除别人项目下的模块', 'status': 0})
    if _edit.api_msg.all():
        return jsonify({'msg': '请先删除模块下的接口用例', 'status': 0})
    db.session.delete(_edit)
    db.session.commit()
    return jsonify({'msg': '删除成功', 'status': 1})
def del_model ( ) : data = request . json ids = data . get ( 'id' ) _edit = Module . get_first ( id = ids ) if current_user . id != Project . query . filter_by ( id = _edit . project_id ) . first ( ) . user_id : return jsonify ( { 'msg' : '不能删除别人项目下的模块', 'status': 0}) if _edit . api_msg . all ( ) : return jsonify ( { 'msg' : '请先删除模块下的接口用例', 'status': 0}) db . session . delete ( _edit ) db . session . commit ( ) return jsonify ( { 'msg' : '删除成功', 'statu s : 1})