That actually works! Many thanks for the suggestion. I wish that could be
in the book if that's the recommended approach.
Dmitry
maybe as a static method ( I did not tested, but may works
On Mon, Nov 21, 2011 at 3:54 PM, Dmitry Vukolov wrote:
> class MyVirtualFields(object):
> def total_price(self):
> return self.support_function(self.item.unit_price,
> self.item.quantity)
@*staticmethod*
def sup
In the Official web2py Book I read about DAL's Virtual Fields that:
"...each method of the class that takes a single argument (self) is a new
virtual field."
It seems however that any function of the class is treated as a new field
and called to calculate its value. As an example I added a supp
3 matches
Mail list logo