Virtual field error :'FieldVirtual' object has no attribute 'listable' in 2.16.1

94 views
Skip to first unread message

icodk

unread,
Dec 2, 2017, 7:26:12 PM12/2/17
to web2py-users
Virtual field definition generate error in 2.16.1-stable+timestamp.2017.11.14.05.54.25
Works  fine in  2.14.06
my field definition is:

db.zone.inside = Field.Virtual('inside', lambda row: 1)

I get the following error:

'FieldVirtual' object has no attribute 'listable'

The field is defined just before a call to grid = SQLFORM.smartgrid(db.zone,...

Thanks for any help

Massimo Di Pierro

unread,
Dec 3, 2017, 12:31:06 PM12/3/17
to web2py-users
I just fixed this in the master branch of pydal. Can you please confirm it is fixed for you?

icodk

unread,
Dec 3, 2017, 6:29:25 PM12/3/17
to web2py-users
Still get the same error (only replaced the objects.py file)
As before the error  shows up if I list the virtual field in the fields parameter. If fields=None then no error, but all fields are shown.

Another isue (might be related) is  if you have a compute field, and edit a record you can't save it. For example directly from the book.:
Field('full_name',compute=lambda r: r['first_name']+' '+r['last_name']),



This also worked before (2.14.06)
Thanks 

domezzzz

unread,
Dec 3, 2017, 7:38:51 PM12/3/17
to web2py-users
Dear Massimo

reference to this same problem:
https://github.com/web2py/web2py/issues/1815

I replaced gluon source with tester version. Give the same error
Thanks

Massimo Di Pierro

unread,
Dec 14, 2017, 3:46:04 AM12/14/17
to web2py-users
I am pretty sure this is fixed in the latest pydal git master. I will build a new web2py version asap.

domezzzz

unread,
Dec 14, 2017, 10:05:45 AM12/14/17
to web2py-users
Thank Massimo.
Reply all
Reply to author
Forward
0 new messages