mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
add cloneFact() back, it's still used by previewing
This commit is contained in:
parent
eac6324fcb
commit
58fd0f253c
1 changed files with 9 additions and 0 deletions
|
@ -1026,6 +1026,15 @@ where facts.id not in (select factId from cards)""")
|
|||
cards.append(card)
|
||||
return cards
|
||||
|
||||
def cloneFact(self, oldFact):
|
||||
"Copy fact into new session."
|
||||
model = self.s.query(Model).get(oldFact.model.id)
|
||||
fact = self.newFact(model)
|
||||
for field in fact.fields:
|
||||
fact[field.name] = oldFact[field.name]
|
||||
fact.tags = oldFact.tags
|
||||
return fact
|
||||
|
||||
# Cards
|
||||
##########################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue