def do(self): params = dict(linked=self.link, name=self.gname) if self.gid is None: sql = Sql.ADD_GROUP else: params["gid"] = self.gid # redo sql = Sql.RE_ADD_GROUP return Query(sql, params)
def do(self): params = dict(saf=self.saf, sortas=self.sortas, term=self.term, pages=self.pages, notes=self.notes, peid=self.peid) if self.eid is None: sql = Sql.INSERT_ENTRY else: params["eid"] = self.eid # redo sql = Sql.REINSERT_ENTRY return Query(sql, params)
def do(self): return Query(Sql.DELETE_GENERIC_XREF, dict(from_eid=self.eid, term=self.term, kind=self.kind))
def undo(self): kind = (XrefKind.SEE_GENERIC if self.kind is XrefKind.SEE_ALSO_GENERIC else XrefKind.SEE_ALSO_GENERIC) return Query(Sql.INSERT_GENERIC_XREF, dict(from_eid=self.eid, term=self.term, kind=kind))
def undo(self): return Query(Sql.INSERT_XREF, dict(from_eid=self.from_eid, to_eid=self.to_eid, kind=self.kind))
def undo(self): return Query(Sql.RENAME_GROUP, dict(gid=self.gid, name=self.oldname))
def undo(self): return Query(Sql.SYNC_PAGES, dict(eid=self.eid, pages=self.oldPages))
def do(self): return Query(Sql.REMOVE_BOOKMARK, dict(eid=self.eid))
def do(self): return Query(Sql.DELETE_ENTRY, dict(eid=self.eid))
def undo(self): return Query(Sql.REMOVE_FROM_GROUP, dict(gid=self.gid, eid=self.eid))
def do(self): return Query(Sql.ADD_TO_GROUP, dict(gid=self.gid, eid=self.eid))
def undo(self): return Query(Sql.UPDATE_GROUP, dict(linked=1, gid=self.gid))
def undo(self): return Query(Sql.RE_ADD_GROUP, dict(gid=self.gid, name=self.gname))
def do(self): return Query(Sql.DELETE_GROUP, dict(gid=self.gid))
def undo(self): return Query(Sql.INSERT_GENERIC_XREF, dict(from_eid=self.eid, term=self.term, kind=self.kind))
def undo(self): return Query(Sql.SWAP_TERMS, dict( eid1=self.eid2, term1=self.term1, sortas1=self.sortas1, saf1=self.saf1, eid2=self.eid1, term2=self.term2, sortas2=self.sortas2, saf2=self.saf2))
def undo(self): params = dict(eid=self.eid, saf=self.saf, sortas=self.sortas, term=self.term, pages=self.pages, notes=self.notes, peid=self.peid) return Query(Sql.UNDELETE_ENTRY, params)
def undo(self): return Query(Sql.ADD_BOOKMARK, dict(eid=self.eid))
def undo(self): params = dict(eid=self.eid, peid=self.old_peid) return Query(Sql.REPARENT_ENTRY, params)
def undo(self): return Query(Sql.UNINSERT_ENTRY, dict(eid=self.eid))
def undo(self): kind = (XrefKind.SEE if self.kind is XrefKind.SEE_ALSO else XrefKind.SEE_ALSO) return Query(Sql.INSERT_XREF, dict(from_eid=self.from_eid, to_eid=self.to_eid, kind=kind))
def undo(self): return Query(Sql.UPDATE_ENTRY, dict(eid=self.entry.eid, saf=self.entry.saf, sortas=self.entry.sortas, term=self.entry.term, pages=self.entry.pages, notes=self.entry.notes))
def do(self): return Query(Sql.DELETE_XREF, dict(from_eid=self.from_eid, to_eid=self.to_eid))