Closed alfonsodg closed 10 years ago
From massimo....@gmail.com on February 05, 2011 20:46:30
This is not a bug. virtual fields can only be computed if the fields required to computed the virtual fields are fetched from the db.
Status: WontFix
From hcv...@googlemail.com on February 05, 2011 22:34:43
Hi Massimo, but shouldn't virtual fiels work as soon as I select the fields required to compute them? At the moment it seems like I have to select everything independent of whether the virtual fields depends on it or not. If, for example, in Line 2 of my example above, the virtual field depended on db.mytable.id alone, the virtual field and the id should be returned, shouldn't they?
From hcv...@googlemail.com on January 30, 2011 13:44:30
Hi,
in 1.91.6 (2011-01-03 17:55:14) 'select' does not always return virtual fields. This is in reference to the w2p group post linked below.
db().select(db.mytable.ALL) # includes virtual fields db().select(db.mytable.id) # does not db().select(db.mytable.virtual_something) # KeyError
Regards, HC
--- http://groups.google.com/group/web2py/browse_thread/thread/ce90bd2b2fb4f24b/6b0e609c6e57a04d?lnk=gst&q=virtualfield+select#6b0e609c6e57a04d
Original issue: http://code.google.com/p/web2py/issues/detail?id=170