From 0755a43b96299169e00e9ab057d580e99af0070c Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 24 Jun 2025 19:44:58 +0300 Subject: Move CaseAttributeEdit to gn3.db, rename diff to changes. Signed-off-by: Munyoki Kilyungi --- gn3/db/case_attributes.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gn3/db/case_attributes.py') diff --git a/gn3/db/case_attributes.py b/gn3/db/case_attributes.py index bb15248..7b56bc4 100644 --- a/gn3/db/case_attributes.py +++ b/gn3/db/case_attributes.py @@ -1,10 +1,28 @@ """Module that contains functions for editing case-attribute data""" from typing import Any, Optional, Tuple +from dataclasses import dataclass import json import MySQLdb +@dataclass +class CaseAttributeEdit: + """Represents an edit operation for case attributes in the database. + + Attributes: + inbredset_id (int): The ID of the inbred set associated with + the edit. + user_id (str): The ID of the user performing the edit. + changes (dict): A dictionary containing the changes to be + applied to the case attributes. + + """ + inbredset_id: int + user_id: str + changes: dict + + def get_case_attributes(conn) -> Optional[Tuple]: """Get all the case attributes from the database.""" with conn.cursor() as cursor: -- cgit 1.4.1