Virtual fields are my new favorite thing. Currently you must call
setvirtualfields after each select. What about adding the ability to
setvirtualfields at the Table level so that any select will call
setvirtualfields automatically? Pseudocode:
db.define_table('mytable',Field('cost'),Field('quantity'))
class ComputedFields:
def amount(self):
return self.mytable.cost*self.mytable.quantity
db.mytable.setvirtualfields(total=ComputedFields())
What do you think?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---