You should use (if only one option is selectable):
db.define_table('data',
Field('name', 'string'),
Field('status', requires=IS_IN_SET(('solved','pending')))
)
or (if both options are selectable)
db.define_table('data',
Field('name', 'string'),
Field('status', 'list:string',
requires=IS_IN_SET(('solved','pending'),multiple=True))
)
On Sep 14, 3:23 am, "dustin.b" <[email protected]> wrote:
> hi i am new to w2p and a few days ago i came across w2p and simply
> want to test it. i came from javaEE and i must say 2 days later i am
> addicted to w2p :D
>
> to my question and i hope its not that stupid but i cant find a simple
> solution or a way the developers meant to.
>
> db.define_table('data',
> Field('name', 'string'),
> Field('status', 'list:string',
> requires=IS_IN_SET(('solved','pending')))
> )
>
> this is my model. i inserted data without any problem, but when i try
> to update that data (with database administration in appadmin), crud
> or sqlform the value in status is not preselected. i have to choose
> one of these to get a valid form. but this is a problem. if i want to
> update a the name (or in real case more other values) i have to choose
> the status ( hopefully i can remember that value ) even if i only want
> to change the name an not the status. if the status where preselected
> there where no problem in only chaning the name.
>
> hopfully i could point out my problem. is there something that i
> missed?
>
> regards ..