def diff(graphids): global diff_id_ctr db = current_app.db dd = DomainDiff(dbsession=db.session) construct_old = GraphConstruct(graphids['src']) construct_new = GraphConstruct(graphids['dst']) diffs[diff_id_ctr] = dd diff_id_ctr += 1 dd.construct(construct_old, construct_new) return {'diffid': diff_id_ctr - 1}
def create(adids): global graph_id_ctr db = current_app.db dg = DomainGraph(dbsession = db.session) for adid in adids: construct = GraphConstruct(adid) dg.construct(construct) graphs[graph_id_ctr] = dg graph_id_ctr += 1 return {'graphid' : graph_id_ctr - 1}
def create(adids): global graph_id_ctr old_graph_id_ctr = graph_id_ctr graph_id_ctr += 1 db = current_app.db dg = DomainGraph(db=db, ) for adid in adids: construct = GraphConstruct(adid) dg.construct(construct) graphs[old_graph_id_ctr] = dg return {'graphid': old_graph_id_ctr}
def object_hook(self, dct): if 'construct' in dct: dct['construct'] = GraphConstruct.from_dict(dct['construct']) return dct