diff --git a/anki/stdmodels.py b/anki/stdmodels.py index e9c588542..991cdeb6a 100644 --- a/anki/stdmodels.py +++ b/anki/stdmodels.py @@ -10,7 +10,7 @@ models = [] # Basic ########################################################################## -def addBasicModel(col): +def _newBasicModel(col): mm = col.models m = mm.new(_("Basic")) fm = mm.newField(_("Front")) @@ -21,7 +21,11 @@ def addBasicModel(col): t['qfmt'] = "{{"+_("Front")+"}}" t['afmt'] = "{{FrontSide}}\n\n
\n\n"+"{{"+_("Back")+"}}" mm.addTemplate(m, t) - mm.add(m) + return m + +def addBasicModel(col): + m = _newBasicModel(col) + col.models.add(m) return m models.append((lambda: _("Basic"), addBasicModel)) @@ -50,12 +54,13 @@ models.append((lambda: _("Basic (type in the answer)"), addBasicTypingModel)) def addForwardReverse(col): mm = col.models - m = addBasicModel(col) + m = _newBasicModel(col) m['name'] = _("Basic (and reversed card)") t = mm.newTemplate(_("Card 2")) t['qfmt'] = "{{"+_("Back")+"}}" t['afmt'] = "{{FrontSide}}\n\n
\n\n"+"{{"+_("Front")+"}}" mm.addTemplate(m, t) + mm.add(m) return m models.append((lambda: _("Basic (and reversed card)"), addForwardReverse)) @@ -65,7 +70,7 @@ models.append((lambda: _("Basic (and reversed card)"), addForwardReverse)) def addForwardOptionalReverse(col): mm = col.models - m = addBasicModel(col) + m = _newBasicModel(col) m['name'] = _("Basic (optional reversed card)") av = _("Add Reverse") fm = mm.newField(av) @@ -74,6 +79,7 @@ def addForwardOptionalReverse(col): t['qfmt'] = "{{#%s}}{{%s}}{{/%s}}" % (av, _("Back"), av) t['afmt'] = "{{FrontSide}}\n\n
\n\n"+"{{"+_("Front")+"}}" mm.addTemplate(m, t) + mm.add(m) return m models.append((lambda: _("Basic (optional reversed card)"),