add {{Subdeck}} special field

If the deck is a several levels into a tree, it can be needlessly
verbose to list them.
This commit is contained in:
Soren I. Bjornstad 2014-09-23 10:00:43 -05:00
parent f3fd5fb2fe
commit dd0e6f2a65

View file

@ -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: