I think you want something like:

Field('duration', 'integer',*compute=lambda r: 
(r['created_on']-r['check_in.created_on']*).days),

or

Field('duration', 'integer', *compute=lambda r: 
(request.now-r['check_in.created_on']*).days),

They should both work but I am more confident about the latter.

On Thursday, 28 March 2013 11:22:02 UTC-5, 黄祥 wrote:
>
> i've already define it, and forgot to paste in this email :
> db._common_fields.append(auth.signature)
>
> i've already input via database administration to make the date and time 
> for check_in.created_on is not on the same day with check_out.created_on 
> but the result for duration field is always return 0:00:00.
>
> any idea why this happen?
> thank you so much in advance
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to