add children argument to decks.cids()

This commit is contained in:
Damien Elmes 2012-02-25 22:10:42 +09:00
parent 05782f9080
commit 2859f9c39d

View file

@ -297,8 +297,14 @@ class DeckManager(object):
c = self.current() c = self.current()
self.select(c['id']) self.select(c['id'])
def cids(self, did): def cids(self, did, children=False):
return self.col.db.list("select id from cards where did=?", did) if not children:
return self.col.db.list("select id from cards where did=?", did)
dids = [did]
for name, id in self.children(did):
dids.append(id)
return self.col.db.list("select id from cards where did in "+
ids2str(dids))
# Deck selection # Deck selection
############################################################# #############################################################