From 3d86a99e55ad05e2acaaa040ae2e71f451fa169b Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Mon, 14 May 2012 14:28:35 -0500 Subject: [PATCH] improved csv does not require id field, issue 795, thanks Dominic Koenig --- VERSION | 2 +- gluon/dal.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 7f078ef7..47100996 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-05-14 14:27:23) dev +Version 2.00.0 (2012-05-14 14:28:31) dev diff --git a/gluon/dal.py b/gluon/dal.py index 556e1597..1ed4b799 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -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