Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 def do(self):
     return Query(Sql.DELETE_GENERIC_XREF, dict(from_eid=self.eid,
                  term=self.term, kind=self.kind))
Example #4
0
 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))
Example #5
0
 def undo(self):
     return Query(Sql.INSERT_XREF, dict(from_eid=self.from_eid,
                  to_eid=self.to_eid, kind=self.kind))
Example #6
0
 def undo(self):
     return Query(Sql.RENAME_GROUP, dict(gid=self.gid, name=self.oldname))
Example #7
0
 def undo(self):
     return Query(Sql.SYNC_PAGES, dict(eid=self.eid,
                                       pages=self.oldPages))
Example #8
0
 def do(self):
     return Query(Sql.REMOVE_BOOKMARK, dict(eid=self.eid))
Example #9
0
 def do(self):
     return Query(Sql.DELETE_ENTRY, dict(eid=self.eid))
Example #10
0
 def undo(self):
     return Query(Sql.REMOVE_FROM_GROUP, dict(gid=self.gid, eid=self.eid))
Example #11
0
 def do(self):
     return Query(Sql.ADD_TO_GROUP, dict(gid=self.gid, eid=self.eid))
Example #12
0
 def undo(self):
     return Query(Sql.UPDATE_GROUP, dict(linked=1, gid=self.gid))
Example #13
0
 def undo(self):
     return Query(Sql.RE_ADD_GROUP, dict(gid=self.gid, name=self.gname))
Example #14
0
 def do(self):
     return Query(Sql.DELETE_GROUP, dict(gid=self.gid))
Example #15
0
 def undo(self):
     return Query(Sql.INSERT_GENERIC_XREF, dict(from_eid=self.eid,
                  term=self.term, kind=self.kind))
Example #16
0
 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))
Example #17
0
 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)
Example #18
0
 def undo(self):
     return Query(Sql.ADD_BOOKMARK, dict(eid=self.eid))
Example #19
0
 def undo(self):
     params = dict(eid=self.eid, peid=self.old_peid)
     return Query(Sql.REPARENT_ENTRY, params)
Example #20
0
 def undo(self):
     return Query(Sql.UNINSERT_ENTRY, dict(eid=self.eid))
Example #21
0
 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))
Example #22
0
 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))
Example #23
0
 def do(self):
     return Query(Sql.DELETE_XREF, dict(from_eid=self.from_eid,
                  to_eid=self.to_eid))