From 9ce1cde6caa23e24565beeec49f7b9a10f1833fb Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 30 Sep 2012 08:32:03 -0500 Subject: [PATCH] fixed issues with grid form and b.parent --- VERSION | 2 +- gluon/globals.py | 8 ++++---- gluon/sqlhtml.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index ef04d69a..b55d9ad4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.9 (2012-09-30 07:30:01) dev +Version 2.0.9 (2012-09-30 08:31:56) dev diff --git a/gluon/globals.py b/gluon/globals.py index f82a6518..c40918fb 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -419,11 +419,11 @@ class Response(Storage): BUTTON = TAG.button admin = URL("admin","default","design", args=current.request.application) - from gluon.dal import thread_local - if hasattr(thread_local,'instances'): + from gluon.dal import THREAD_LOCAL + if hasattr(THREAD_LOCAL,'instances'): dbstats = [TABLE(*[TR(PRE(row[0]),'%.2fms' % (row[1]*1000)) \ for row in i.db._timings]) \ - for i in thread_local.instances] + for i in THREAD_LOCAL.instances] dbtables = dict([(regex_nopasswd.sub('******',i.uri), {'defined': sorted(list(set(i.db.tables) - @@ -431,7 +431,7 @@ class Response(Storage): '[no defined tables]', 'lazy': sorted(i.db._LAZY_TABLES.keys()) or '[no lazy tables]'}) - for i in thread_local.instances]) + for i in THREAD_LOCAL.instances]) else: dbstats = [] # if no db or on GAE dbtables = {} diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 2868f462..47b3c823 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -1150,7 +1150,7 @@ class SQLFORM(FORM): else: table = formstyle(self, xfields) for id,a,b,c in xfields: - self.field_parent[id] = b.parent + self.field_parent[id] = getattr(b,'parent',None) else: raise RuntimeError, 'formstyle not supported' return table