Field('valor_total','double', default=None, update=None, readable=False),

db.cronograma_desembolso.valor_total.compute=lambda r:
r['valor_custeio_concedente']+ r['valor_investimento_concedente'] +
r['valor_custeio_contrapartida']+ r['valor_investimento_contrapartida']

(one line above)

2010/1/14 Alexandre Andrade <[email protected]>

> It don't show at form, without readable=False.
>
> I set readable=False, but it don't show the updated value.
>
> 2010/1/14 mdipierro <[email protected]>
>
>> Can you also try set readable=False?
>>
>>
>> On Jan 14, 9:52 am, mdipierro <[email protected]> wrote:
>> > Make sure Field(...,default=None, update=None)
>> >
>> > On Jan 14, 9:47 am, Alexandre Andrade <[email protected]>
>> > wrote:
>> >
>> > > db.order_detail.total.compute=lambda r: r['qtd']*r['price']
>> >
>> > > don't work on updates
>> >
>> > > 2010/1/14 mdipierro <[email protected]>
>> >
>> > > > 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 <[email protected]>
>> > > > 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 [email protected].
>> > > > To unsubscribe from this group, send email to
>> > > > [email protected]<web2py%[email protected]>
>> <web2py%[email protected]<web2py%[email protected]>
>> >
>> > > > .
>> > > > 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 [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<web2py%[email protected]>
>> .
>>
>> For more options, visit this group at
>> http://groups.google.com/group/web2py?hl=en.
>>
>>
>>
>>
>
>
> --
> Atenciosamente
>
> --
> =========================
> Alexandre Andrade
> Hipercenter.com
>



-- 
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 [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.

Reply via email to