Code refactor for change set
This commit is contained in:
@@ -30,7 +30,7 @@ class Emitter(object):
|
||||
return { 'type': self.type, 'junction': self.junction, 'coefficient': self.coefficient }
|
||||
|
||||
|
||||
def set_emitter_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
def set_emitter_cache(name: str, cs: ChangeSet) -> DbChangeSet:
|
||||
old = Emitter(get_emitter(name, cs.operations[0]['junction']))
|
||||
raw_new = get_emitter(name, cs.operations[0]['junction'])
|
||||
|
||||
@@ -52,7 +52,7 @@ def set_emitter_cache(name: str, cs: ChangeSet) -> SqlChangeSet:
|
||||
redo_cs = g_update_prefix | new.as_dict()
|
||||
undo_cs = g_update_prefix | old.as_dict()
|
||||
|
||||
return SqlChangeSet(redo_sql, undo_sql, redo_cs, undo_cs)
|
||||
return DbChangeSet(redo_sql, undo_sql, [redo_cs], [undo_cs])
|
||||
|
||||
|
||||
def set_emitter(name: str, cs: ChangeSet) -> ChangeSet:
|
||||
|
||||
Reference in New Issue
Block a user