still don't work. The value before still mantains. Maybe I have to drop the column and create it again?
2010/1/14 mdipierro <mdipie...@cs.depaul.edu> > Make sure Field(...,default=None, update=None) > > On Jan 14, 9:47 am, Alexandre Andrade <alexandrema...@gmail.com> > wrote: > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > don't work on updates > > > > 2010/1/14 mdipierro <mdipie...@cs.depaul.edu> > > > > > > > > > with 1.74.5 and later you only need > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > On Jan 14, 8:51 am, Alexandre Andrade <alexandrema...@gmail.com> > > > wrote: > > > > What is the best solution to automatically calculate a total field? > > > > > > db.define_table ('order_detail', > > > > Field('product_name'), > > > > Field('qtd', 'integer'), > > > > Field('price', 'integer'), > > > > Field('total', 'integer', writable=False) > > > > ) > > > > > > Where total = qtd * price > > > > > > requires and a custom validator? how to do? > > > > onvalidation on form? how to do? > > > > > > -- > > > > Atenciosamente > > > > > > -- > > > > ========================= > > > > Alexandre Andrade > > > > Hipercenter.com > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "web2py-users" group. > > > To post to this group, send email to web...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > web2py+unsubscr...@googlegroups.com<web2py%2bunsubscr...@googlegroups.com> > <web2py%2bunsubscr...@googlegroups.com<web2py%252bunsubscr...@googlegroups.com> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/web2py?hl=en. > > > > -- > > Atenciosamente > > > > -- > > ========================= > > Alexandre Andrade > > Hipercenter.com > > -- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To post to this group, send email to web...@googlegroups.com. > To unsubscribe from this group, send email to > web2py+unsubscr...@googlegroups.com<web2py%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/web2py?hl=en. > > > > -- Atenciosamente -- ========================= Alexandre Andrade Hipercenter.com--
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/web2py?hl=en.