Re: [web2py] Re: Question about SQLFORM.grid - process a column before show it

2012-12-21 Thread Christian Espinoza
Wow!! Thanks Niphlod, this tip worked like a charm!! El jueves, 20 de diciembre de 2012 20:53:14 UTC-3, Niphlod escribió: > > my bad, sorry Christian. > > myset = { 0:'Quiet',1:'Running',2:'Fail'} > > Field('action', 'integer', > requires=IS_IN_SET(myset), > represent=lamb

Re: [web2py] Re: Question about SQLFORM.grid - process a column before show it

2012-12-20 Thread Niphlod
my bad, sorry Christian. myset = { 0:'Quiet',1:'Running',2:'Fail'} Field('action', 'integer', requires=IS_IN_SET(myset), represent=lambda value, row: myset.get(value, None) # or myset[value] if you are totally sure that myset contains all the possible values

Re: [web2py] Re: Question about SQLFORM.grid - process a column before show it

2012-12-20 Thread villas
I guess you need to use: actions.represent as well. On Thursday, December 20, 2012 9:46:58 PM UTC, Niphlod wrote: > > Disclaimer: not tested > why don't you just change the action Field to > > Field('action', requires=IS_IN_SET({ 0:'Quiet',1:'Running',2:'Fail'})) > > On Thursday, December 20

Re: [web2py] Re: Question about SQLFORM.grid - process a column before show it

2012-12-20 Thread Niphlod
Disclaimer: not tested why don't you just change the action Field to Field('action', requires=IS_IN_SET({ 0:'Quiet',1:'Running',2:'Fail'})) On Thursday, December 20, 2012 10:23:07 PM UTC+1, Jim S wrote: > > Have you though about adding a table to define the relation between > 'index' and the te

Re: [web2py] Re: Question about SQLFORM.grid - process a column before show it

2012-12-20 Thread Jim Steil
Have you though about adding a table to define the relation between 'index' and the text: db_actions.define_table('actions', Field(name, length=20, label='Action')) Then modify db_events so field index looks like: Field('index', db.actions, label='Action), Table actions would then have three re