thanks for the update, good to hear you got it working.
-Jim
On 12/22/2011 6:13 AM, Jose Carlos Junior wrote:
Sorry it worked.....i made a mistake.... Thank you Jim .... On 22 Dez, 09:46, Jose Carlos Junior<[email protected]> wrote:Dont worked....the field dont show in form.... Sorry...any ideas ?? On 21 Dez, 22:05, Jose Carlos Junior<[email protected]> wrote:Thank you Jim .....i gonna try this as soon as possible....and return... On 21 dez, 18:21, Jim Steil<[email protected]> wrote:Here's what I would try: Field('difference', compute=lambda u: (u['DT_FECHAMENTO '] - u['DT_ABERTURA ']), label='Difference') This is untested. I haven't used compute fields based on a math function before, but like I said, this is what I'd try first. Hope this helps. -Jim On 12/21/2011 1:43 PM, Jose Carlos Junior wrote:People, How can I make the field NR_INDISPONIBILIDADE the table below (chamado) in a computed field with the difference between the field dates DT_FECHAMENTO and DT_ABERTURA. Thank you, db.define_table("chamados" ,Field('ID_CHAMADOS',type='id',readable=False) ,Field('ID_TECNICOS',type='integer',notnull=True,label='T cnico') ,Field('ID_CIRCUITOS',type='integer',notnull=True,label='Circuito') ,Field('NR_CHAMADO',type='string',notnull=False,label='Chamado') ,Field('DT_ABERTURA',type='datetime',notnull=True,label='Abertura') ,Field('DT_FECHAMENTO',type='datetime',notnull=False,label='Fechamento') ,Field('NR_INDISPONIBILIDADE',type='double',notnull=False,label='Indisponib ilidade') ,Field('FL_OFENSOR',type='boolean',label='Ofensor',default=True) ,migrate=False )

