[web2py] Re: Virtual Fields using PyDAL outside of web2py

2020-04-23 Thread Jim S
Massimiliano Thanks for the reply. Adding the fieldname didn't help, but pushed me to look again at the other post I'd referenced. In it I missed adding the tablename to the row.id. It should be row.workorder.id. I made that change and now it works. So, the solution is: db.workorder.child

[web2py] Re: Virtual Fields using PyDAL outside of web2py

2020-04-23 Thread Massimiliano
Maybe you miss fieldname: db.workorder.children = Field.Virtual(*fieldname*, lambda row: db(db. workorder.parent_workorder == row.id).select()) On Thursday, April 23, 2020 at 4:41:23 PM UTC+2, Jim S wrote: > > Given the following: > > from pydal import DAL > from pydal.objects import Field, Fie

[web2py] Re: Virtual Fields using PyDAL outside of web2py

2020-04-23 Thread Jim S
I should also mention that I have been looking at this post, but can't see what I'm doing wrong.. https://groups.google.com/forum/?pli=1#!newtopic/web2py/web2py/PpouIgeIwX8 On Thursday, April 23, 2020 at 9:41:23 AM UTC-5, Jim S wrote: > > Given the following: > > from pydal import DAL > from py