improved csv does not require id field, issue 795, thanks Dominic Koenig

This commit is contained in:
Massimo Di Pierro
2012-05-14 14:28:35 -05:00
parent bb946b34a8
commit 3d86a99e55
2 changed files with 3 additions and 3 deletions

View File

@@ -1 +1 @@
Version 2.00.0 (2012-05-14 14:27:23) dev
Version 2.00.0 (2012-05-14 14:28:31) dev

View File

@@ -7212,7 +7212,7 @@ class Table(dict):
'restore' argument is default False. If set True will remove old values
in table first.
'id_map' If set to None will not map id. The import will keep the id numbers
in the restored table. This assumes that there is an field of type id that
in the restored table. This assumes that there is an field of type id that
is integer and in incrementing order. Will keep the id numbers in restored table.
"""
@@ -7289,7 +7289,7 @@ class Table(dict):
else:
items = [fix(self[colnames[i]], line[i], id_map, id_offset) \
for i in cols if colnames[i] in self.fields]
if not id_map:
if not id_map and cid:
csv_id = int(line[cid])
curr_id = self.insert(**dict(items))
del_id = curr_id