Added files field to model info
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -96,13 +96,13 @@ class SVMView(FlaskView):
|
||||
|
||||
return jsonify(self.aimodel_schema.dump(m)), 200
|
||||
|
||||
def delete(self, _id: str):
|
||||
def delete(self, id_: str):
|
||||
|
||||
if _id == "$default":
|
||||
if id_ == "$default":
|
||||
default = Default.query.filter_by(type=AIModelType.svm).first_or_404()
|
||||
m = default.aimodel
|
||||
else:
|
||||
m = AIModel.query.filter_by(type=AIModelType.svm, id=_id).first_or_404()
|
||||
m = AIModel.query.filter_by(type=AIModelType.svm, id=id_).first_or_404()
|
||||
|
||||
storage.connection.remove_object(current_app.config['MINIO_SVM_BUCKET_NAME'], "means/" + str(m.id))
|
||||
storage.connection.remove_object(current_app.config['MINIO_SVM_BUCKET_NAME'], "model/" + str(m.id))
|
||||
@@ -113,14 +113,14 @@ class SVMView(FlaskView):
|
||||
return '', 204
|
||||
|
||||
# builtin file proxy
|
||||
@route('<_id>/file')
|
||||
def get_file(self, _id: str):
|
||||
@route('<id_>/file')
|
||||
def get_file(self, id_: str):
|
||||
|
||||
if _id == "$default":
|
||||
if id_ == "$default":
|
||||
default = Default.query.filter_by(type=AIModelType.svm).first_or_404()
|
||||
m = default.aimodel
|
||||
else:
|
||||
m = AIModel.query.filter_by(type=AIModelType.svm, id=_id).first_or_404()
|
||||
m = AIModel.query.filter_by(type=AIModelType.svm, id=id_).first_or_404()
|
||||
|
||||
if "means" in request.args:
|
||||
path = "means/" + str(m.id)
|
||||
|
||||
Reference in New Issue
Block a user