add check for first field

This commit is contained in:
Damien Elmes 2012-04-06 13:34:29 +09:00
parent 7d8c0d96b5
commit 13049339ac

View file

@ -70,6 +70,9 @@ class NoteImporter(Importer):
flds = flds + [None] * (self.fields() - len(flds))
self.mapping = flds
def mappingOk(self):
return self.model['flds'][0]['name'] in self.mapping
def foreignNotes(self):
"Return a list of foreign notes for importing."
assert 0
@ -80,6 +83,7 @@ class NoteImporter(Importer):
def importNotes(self, notes):
"Convert each card into a note, apply attributes and add to col."
assert self.mappingOk()
# gather checks for duplicate comparison
csums = {}
for csum, id in self.col.db.execute(