From efe42cd86d7b333db6913341e9ee08b8be1d2838 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Thu, 26 Jun 2025 11:57:55 +0300 Subject: Add update case-attributes function. Signed-off-by: Munyoki Kilyungi --- gn3/api/case_attributes.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'gn3/api/case_attributes.py') diff --git a/gn3/api/case_attributes.py b/gn3/api/case_attributes.py index 7053e6a..b7c04f9 100644 --- a/gn3/api/case_attributes.py +++ b/gn3/api/case_attributes.py @@ -468,27 +468,7 @@ def __reject_diff__(conn: Connection, return diff_filename -def __update_case_attributes__( - cursor, inbredset_id: int, modifications) -> None: - for strain, changes in modifications.items(): - for case_attribute, value in changes.items(): - value = value.strip() - cursor.execute("SELECT Id AS StrainId, Name AS StrainName FROM Strain " - "WHERE Name = %s", - (strain,)) - - strain_id, _ = cursor.fetchone() - cursor.execute("SELECT CaseAttributeId, Name AS CaseAttributeName " - "FROM CaseAttribute WHERE InbredSetId = %s " - "AND Name = %s", - (inbredset_id, case_attribute,)) - case_attr_id, _ = cursor.fetchone() - cursor.execute( - "INSERT INTO CaseAttributeXRefNew" - "(InbredSetId, StrainId, CaseAttributeId, Value) " - "VALUES (%s, %s, %s, %s) " - "ON DUPLICATE KEY UPDATE Value=VALUES(value)", - (inbredset_id, strain_id, case_attr_id, value,)) + @caseattr.route("//add", methods=["POST"]) -- cgit 1.4.1