diff options
| author | Munyoki Kilyungi | 2025-06-26 11:57:55 +0300 |
|---|---|---|
| committer | BonfaceKilz | 2025-07-07 07:58:31 +0300 |
| commit | efe42cd86d7b333db6913341e9ee08b8be1d2838 (patch) | |
| tree | 9be1af913bebcb703a44430f2a598f7298651371 /gn3/api | |
| parent | 86ac8ac9664b4406a1aa51cd24381377156347a2 (diff) | |
| download | genenetwork3-efe42cd86d7b333db6913341e9ee08b8be1d2838.tar.gz | |
Add update case-attributes function.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/api')
| -rw-r--r-- | gn3/api/case_attributes.py | 22 |
1 files changed, 1 insertions, 21 deletions
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("/<int:inbredset_id>/add", methods=["POST"]) |
