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
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
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
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
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
5 matches
Mail list logo