From 3c6707c17f279d5b9d14ffc0eae086b8acee3143 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 22 Apr 2012 08:27:31 +0900 Subject: [PATCH] don't genCards() into a cram deck --- anki/collection.py | 4 ++++ anki/decks.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/anki/collection.py b/anki/collection.py index d9b23c7d2..5c2438f1a 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -318,6 +318,10 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""", for t in self._tmplsFromOrds(model, avail): doHave = nid in have and t['ord'] in have[nid] if not doHave: + # check deck is not a cram deck + did = t['did'] or did + if self.decks.isDyn(did): + did = 1 # we'd like to use the same due# as sibling cards, but we # can't retrieve that quickly, so we give it a new id # instead diff --git a/anki/decks.py b/anki/decks.py index 765722e02..f2c011656 100644 --- a/anki/decks.py +++ b/anki/decks.py @@ -417,3 +417,6 @@ class DeckManager(object): did = self.id(name, type=defaultDynamicDeck) self.select(did) return did + + def isDyn(self, did): + return self.get(did)['dyn']