From 6860f64f2872502fd5141e71686ca0f16b56b4f2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 17 Dec 2010 02:03:35 +0900 Subject: [PATCH] try to recover tags of card, too --- anki/deck.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anki/deck.py b/anki/deck.py index 1d31afd3f..a7b73dbd6 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -3246,6 +3246,9 @@ where id in %s""" % ids2str(ids)): f = self.newFact() f['Question'] = repl(q) f['Answer'] = repl(a) + f.tags = self.s.scalar(""" +select group_concat(tag, " ") from tags t, cardTags ct +where cardId = :cid and ct.tagId = t.id""", cid=id) or u"" cards = self.addFact(f) # delete the freshly created card and point old card to this fact self.s.statement("delete from cards where id = :id",