From 74ccb85ed958ca122100e9944e231b0fa26d5206 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Mon, 16 Jan 2012 21:46:23 -0600 Subject: [PATCH] issue 613, not sure if completely resolved, needs more testing --- VERSION | 2 +- gluon/sqlhtml.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index fdae0e0e..cdeb49fc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.4 (2012-01-16 21:39:52) stable +Version 1.99.4 (2012-01-16 21:46:16) stable diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 65431dbb..6be176fe 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -801,12 +801,12 @@ class SQLFORM(FORM): self.custom.inpval.id = '' widget = '' if record: - if showid and 'id' in fields and field.readable: - v = record['id'] + if showid and field.name in record and field.readable: + v = record[field.name] widget = SPAN(v, _id=field_id) self.custom.dspval.id = str(v) xfields.append((row_id,label, widget,comment)) - self.record_id = str(record['id']) + self.record_id = str(record[field.name]) self.custom.widget.id = widget continue @@ -944,7 +944,7 @@ class SQLFORM(FORM): if not self['hidden']: self['hidden'] = {} if not keyed: - self['hidden']['id'] = record['id'] + self['hidden']['id'] = record[table._id.name] (begin, end) = self._xml() self.custom.begin = XML("<%s %s>" % (self.tag, begin))