|
|
|
@ -268,7 +268,7 @@ class InfoHandler(APIHandler):
|
|
|
|
|
text(
|
|
|
|
|
"""
|
|
|
|
|
select
|
|
|
|
|
m.name, m.model_type, m.comment, m.update_time,
|
|
|
|
|
m.name, m.model_type, m.default_version, m.comment, m.update_time,
|
|
|
|
|
mc.id as classification_id, mc.name as classification_name
|
|
|
|
|
from model m, model_classification mc
|
|
|
|
|
where m.id=:id and m.classification=mc.id
|
|
|
|
@ -284,6 +284,7 @@ class InfoHandler(APIHandler):
|
|
|
|
|
data = {
|
|
|
|
|
"name": result["name"],
|
|
|
|
|
"model_type": result["model_type"],
|
|
|
|
|
"default_version": result["default_version"],
|
|
|
|
|
"classification_id": result["classification_id"],
|
|
|
|
|
"classification_name": result["classification_name"],
|
|
|
|
|
"comment": result["comment"],
|
|
|
|
@ -621,6 +622,11 @@ class VersionSetDefaultHandler(APIHandler):
|
|
|
|
|
text("update model_version set is_default=1 where id=:id"),
|
|
|
|
|
{"id": version_id},
|
|
|
|
|
)
|
|
|
|
|
conn.execute(
|
|
|
|
|
text("update model m set m.default_version=(select version from model_version v where v.id=:vid) "
|
|
|
|
|
"where m.id=:mid"),
|
|
|
|
|
{"vid": version_id, "mid": model_id}
|
|
|
|
|
)
|
|
|
|
|
conn.commit()
|
|
|
|
|
|
|
|
|
|
self.finish()
|
|
|
|
|