From 97385d331009f535353cadc0de3575dba7a2fd0e Mon Sep 17 00:00:00 2001 From: Massimo Date: Tue, 15 Jan 2013 13:19:54 -0600 Subject: [PATCH] another parse_as_rest patch, thanks Denes --- VERSION | 2 +- gluon/dal.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 67536eeb..a56b2937 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.2+timestamp.2013.01.15.13.09.31 +Version 2.4.1-alpha.2+timestamp.2013.01.15.13.19.22 diff --git a/gluon/dal.py b/gluon/dal.py index a443db4b..11f47fe4 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7378,8 +7378,10 @@ def index(): selfld = '_id' if db[table][field].type.startswith('reference '): refs = [ x.name for x in db[otable] if x.type == db[table][field].type ] - if refs: - selfld = refs[0] + else: + refs = [ x.name for x in db[table]._referenced_by if x.tablename==otable ] + if refs: + selfld = refs[0] if nested_select: try: dbset=db(db[table][field].belongs(dbset._select(db[otable][selfld])))