On 17 mar, 23:54, Jose <[email protected]> wrote:
> Fails,
>
> in model/db.py
>
> db.define_table('sales',
> Field('item'),
> Field('item_total', 'double'),
> Field('tax_percentage', 'double'),
> Field('trans_date', 'datetime'),
> )
>
> class Sales():
> def total(self):
> return self.item_total * self.tax_percentage
> def tax(self):
> return self.total() - self.item_total
>
must be changed for this:
class Sales():
def total(self):
return self.sales.item_total * self.sales.tax_percentage
def tax(self):
return self.total() - self.sales.item_total
--
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.