mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
add deck and tags as default extra fields
This commit is contained in:
parent
f1140cf886
commit
f57f386b59
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue