[web2py] Doing a select in a Virtual Field

2011-08-15 Thread Tom Coetser
Hi All, I'm new to web2py and am trying to get my mind around how virtual fields work. Given the following table: db.define_table(trip, Field(date, date), Field(odo, integer) ) which represents a trip taken by car on a specific date and the

Re: [web2py] Doing a select in a Virtual Field

2011-08-15 Thread Tom Coetser
On Monday 15 August 2011 19:47:09 pbreit wrote: I think you might have to dereference r. Something like r[0].odo since queries return a set even if there's only one element. From my tests, the .first() in the query: r = db(q).select(db.trip.odo, orderby=o, limitby=(0,1)).first() seems to