From 6acc6e68e0d75c5df3d25bcf442535e799bbcf2c Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 25 Jul 2012 21:04:56 -0500 Subject: [PATCH] possibly fixed issue 908 --- VERSION | 2 +- gluon/dal.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 27e8cae4..a5d94812 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-25 18:34:46) dev +Version 2.00.0 (2012-07-25 21:04:51) dev diff --git a/gluon/dal.py b/gluon/dal.py index 7aadc901..50d52717 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7112,6 +7112,9 @@ class Table(dict): "primarykey must be a list of fields from table '%s'" \ % tablename self._primarykey = primarykey + if len(primarykey)==1: + self._id = [f for f in fields if isinstance(f,Field) \ + and f.name==primarykey[0]][0] elif not [f for f in fields if isinstance(f,Field) and f.type=='id']: field = Field('id', 'id') newfields.append(field)