From dd0e6f2a652e624c6e2a6b0d769e72a04a398941 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Tue, 23 Sep 2014 10:00:43 -0500 Subject: [PATCH] add {{Subdeck}} special field If the deck is a several levels into a tree, it can be needlessly verbose to list them. --- anki/collection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/anki/collection.py b/anki/collection.py index c5b2a3e20..3f068d457 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -498,6 +498,7 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)): fields['Tags'] = data[5].strip() fields['Type'] = model['name'] fields['Deck'] = self.decks.name(data[3]) + fields['Subdeck'] = fields['Deck'].split('::')[-1] if model['type'] == MODEL_STD: template = model['tmpls'][data[4]] else: