add card tags to fact

This commit is contained in:
Damien Elmes 2008-11-30 05:47:36 +09:00
parent 320d1fa758
commit 1e98f8bf81

View file

@ -17,7 +17,7 @@ import time
from anki.cards import cardsTable from anki.cards import cardsTable
from anki.facts import factsTable, fieldsTable from anki.facts import factsTable, fieldsTable
from anki.lang import _ from anki.lang import _
from anki.utils import genID from anki.utils import genID, canonifyTags
from anki.errors import * from anki.errors import *
# Base importer # Base importer
@ -121,7 +121,7 @@ all but one card model."""))
factIds = [genID() for n in range(len(cards))] factIds = [genID() for n in range(len(cards))]
self.deck.s.execute(factsTable.insert(), self.deck.s.execute(factsTable.insert(),
[{'modelId': self.model.id, [{'modelId': self.model.id,
'tags': self.tagsToAdd, 'tags': canonifyTags(self.tagsToAdd + "," + cards[n].tags),
'id': factIds[n]} for n in range(len(cards))]) 'id': factIds[n]} for n in range(len(cards))])
self.deck.factCount += len(factIds) self.deck.factCount += len(factIds)
self.deck.s.execute(""" self.deck.s.execute("""