rename special field templates

This commit is contained in:
Damien Elmes 2011-12-12 01:39:57 +09:00
parent 428b6a0520
commit 1114fc084a
2 changed files with 4 additions and 4 deletions

View file

@ -445,10 +445,10 @@ select id from notes where id in %s and id not in (select nid from cards)""" %
for (name, (idx, conf)) in self.models.fieldMap(model).items():
fields[name] = flist[idx]
fields['Tags'] = data[5]
fields['Model'] = model['name']
fields['Type'] = model['name']
fields['Deck'] = self.decks.name(data[3])
template = model['tmpls'][data[4]]
fields['Template'] = template['name']
fields['Card'] = template['name']
# render q & a
d = dict(id=data[0])
for (type, format) in (("q", template['qfmt']), ("a", template['afmt'])):

View file

@ -404,9 +404,9 @@ order by ordinal""", mid)):
conf[type] = re.sub(
"(?i){{tags}}", "{{Tags}}", conf[type])
conf[type] = re.sub(
"(?i){{cardModel}}", "{{Template}}", conf[type])
"(?i){{cardModel}}", "{{Card}}", conf[type])
conf[type] = re.sub(
"(?i){{modelTags}}", "{{Model}}", conf[type])
"(?i){{modelTags}}", "{{Type}}", conf[type])
# type answer is now embedded in the format
if typeAns:
if type == "qfmt" or hideq: