list:reference with SQLFORM.grid

59 views
Skip to first unread message

villas

unread,
May 24, 2015, 7:58:26 PM5/24/15
to web...@googlegroups.com
Hi All,

Can someone see what the problem is please?

db.define_table('tag', Field('name'))
db.define_table('test',Field('name'),Field('tags','list:reference tag'))

def test():
grid = SQLFORM.grid(db.test, user_signature = False)
return dict(grid=grid)

Navigate to function test, try using the grid. Save a record etc and view it.....

Traceback (most recent call last):
File "C:\Users\David\Documents\GitHub\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
File "C:/Users/David/Documents/GitHub/web2py/applications/owners/controllers/default.py", line 181, in <module>
File "C:\Users\David\Documents\GitHub\web2py\gluon\globals.py", line 403, in <lambda>
self._caller = lambda f: f()
File "C:/Users/David/Documents/GitHub/web2py/applications/owners/controllers/default.py", line 139, in test
grid = SQLFORM.grid(db.test, fields=[db.test.id,db.test.name], user_signature = False)
File "C:\Users\David\Documents\GitHub\web2py\gluon\sqlhtml.py", line 2252, in grid
view_form = SQLFORM(table, record, **sqlformargs)
File "C:\Users\David\Documents\GitHub\web2py\gluon\sqlhtml.py", line 1203, in __init__
inp = represent(field, default, record)
File "C:\Users\David\Documents\GitHub\web2py\gluon\sqlhtml.py", line 68, in represent
return f(value)
File "C:\Users\David\Documents\GitHub\web2py\gluon\packages\dal\pydal\helpers\methods.py", line 268, in __call__
if isinstance(db._adapter, GoogleDatastoreAdapter):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

Mark Graves

unread,
May 25, 2015, 1:37:35 AM5/25/15
to web...@googlegroups.com
I seem to be having the same problem. 

Paolo Valleri

unread,
May 25, 2015, 2:06:24 AM5/25/15
to web...@googlegroups.com
This issue has been already fixed https://github.com/web2py/pydal/commit/2172b776b9c41884717902e68900b41c105e0364#diff-114ce07f361177e0669ec9a374ef7d6a
Have you updated web2py  (and pydal) properly? 

Paolo

villas

unread,
May 25, 2015, 5:16:30 AM5/25/15
to web...@googlegroups.com
>>  Have you updated web2py  (and pydal) properly?

Hi Paolo,
Many thanks for looking into this.
I updated earlier this weekend with git pull. 
How would I do it 'properly',  do I have to use the recursive every time?
Cheers,  D

Reply all
Reply to author
Forward
0 new messages