[web2py] Re: apply a function to a column in db query

2014-09-07 Thread Anna Kostikova
Thanks a lot Anthony, it really helped! Anna On Sunday, 7 September 2014 03:34:42 UTC+2, Anthony wrote: > > For transformation for display in the grid, SQLTABLE, and read-only form > fields, you can use the "represent" attribute of the field: > > db.define_table('mytable', > Field('mytime', r

[web2py] Re: apply a function to a column in db query

2014-09-06 Thread Anthony
For transformation for display in the grid, SQLTABLE, and read-only form fields, you can use the "represent" attribute of the field: db.define_table('mytable', Field('mytime', represent=lambda v, r: time.strftime('%Y-%m-%d %H:%M:%S' , time.localtime(v If you want to make sure the transfo