Code refactor for change set
This commit is contained in:
@@ -13,7 +13,7 @@ def get_control(name: str) -> dict[str, Any]:
|
||||
return { 'controls': ds }
|
||||
|
||||
|
||||
def set_control_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
def set_control_cache(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
old = get_control(name)
|
||||
|
||||
redo_sql = 'delete from controls;'
|
||||
@@ -27,7 +27,7 @@ def set_control_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
redo_cs = g_update_prefix | { 'type': 'control', 'controls': cs.operations[0]['controls'] }
|
||||
undo_cs = g_update_prefix | { 'type': 'control', 'controls': old['controls'] }
|
||||
|
||||
return SqlChangeSet(redo_sql, undo_sql, redo_cs, undo_cs)
|
||||
return DbChangeSet(redo_sql, undo_sql, [redo_cs], [undo_cs])
|
||||
|
||||
|
||||
def set_control(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
|
||||
Reference in New Issue
Block a user