Exemplo n.º 1
0
 def remove_notes_by_card(self, card_ids: List[int]) -> None:
     if hooks.notes_will_be_deleted.count():
         nids = self.db.list(
             "select nid from cards where id in " + ids2str(card_ids)
         )
         hooks.notes_will_be_deleted(self, nids)
     self.backend.remove_notes(note_ids=[], card_ids=card_ids)
Exemplo n.º 2
0
 def _remNotes(self, ids: List[int]) -> None:
     """Bulk delete notes by ID. Don't call this directly."""
     if not ids:
         return
     strids = ids2str(ids)
     # we need to log these independently of cards, as one side may have
     # more card templates
     hooks.notes_will_be_deleted(self, ids)
     self._logRem(ids, REM_NOTE)
     self.db.execute("delete from notes where id in %s" % strids)
Exemplo n.º 3
0
 def remove_notes(self, note_ids: Sequence[int]) -> None:
     hooks.notes_will_be_deleted(self, note_ids)
     self._backend.remove_notes(note_ids=note_ids, card_ids=[])