dal.py: BaseAdapter: insert: solved problem when creating new record without passing the primary key as argument
This commit is contained in:
@@ -1363,6 +1363,8 @@ class BaseAdapter(ConnectionPool):
|
|||||||
if mydict != {}:
|
if mydict != {}:
|
||||||
return mydict
|
return mydict
|
||||||
id = self.lastrowid(table)
|
id = self.lastrowid(table)
|
||||||
|
if hasattr(table, '_primarykey') and len(table._primarykey) == 1:
|
||||||
|
id = {table._primarykey[0]: id}
|
||||||
if not isinstance(id, (int, long)):
|
if not isinstance(id, (int, long)):
|
||||||
return id
|
return id
|
||||||
rid = Reference(id)
|
rid = Reference(id)
|
||||||
|
|||||||
Reference in New Issue
Block a user