From f57f386b59d66b71f1c8f4847385a7f04bafeab0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 20 Mar 2012 04:53:00 +0900 Subject: [PATCH] add deck and tags as default extra fields --- anki/importing/noteimp.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/anki/importing/noteimp.py b/anki/importing/noteimp.py index 53832bc90..83532b2b0 100644 --- a/anki/importing/noteimp.py +++ b/anki/importing/noteimp.py @@ -64,7 +64,13 @@ class NoteImporter(Importer): flds = [f['name'] for f in self.model['flds']] # truncate to provided count flds = flds[0:self.fields()] - # if provided count is greater, pad + # if there's room left, add deck + if self.fields() > len(flds): + flds.append("_deck") + # and tags + if self.fields() > len(flds): + flds.append("_tags") + # and if there's still room left, pad flds = flds + [None] * (self.fields() - len(flds)) self.mapping = flds