[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
Thank you again, you solved two problems of mine today On Sunday, October 7, 2012 7:23:04 PM UTC-7, Anthony wrote: > > Something like: > > SELECT(*[r.type for r in db().select(db.tiers.type)], ...) > > SELECT() takes OPTION() elements as its components, but if you give it > items not wrapped in O

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
Something like: SELECT(*[r.type for r in db().select(db.tiers.type)], ...) SELECT() takes OPTION() elements as its components, but if you give it items not wrapped in OPTION, it will automatically do so. Anthony On Sunday, October 7, 2012 9:42:06 PM UTC-4, dave wrote: > > so how do I go about

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
so how do I go about doing that, I have this so far SELECT(_type='text', _name='test0', requires=IS_IN_DB(db, db.tiers.type, '%(type)s'))) On Sunday, October 7, 2012 6:21:49 PM UTC-7, Anthony wrote: > > Yes, you have to include the options in the SELECT() -- the SELECT() > doesn't know it shoul

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
Yes, you have to include the options in the SELECT() -- the SELECT() doesn't know it should get the options from the IS_IN_DB validator. Anthony On Sunday, October 7, 2012 3:01:48 PM UTC-4, dave wrote: > > ok I got it to display using select() > > SELECT(_type='text', _name='test0', requires=I

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
On Sunday, October 7, 2012 4:57:06 PM UTC-4, Niphlod wrote: > that's because web2py doesn't know what you expect to be filled in your > model. If you add the requires= bit to your "type" field, then > automatically web2py will turn that field into a SELECT with the correct > options. > It won'

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
I did requires=IS_IN_DB(db, db.tiers.type, '%(type)s') On Sunday, October 7, 2012 1:57:06 PM UTC-7, Niphlod wrote: > > that's because web2py doesn't know what you expect to be filled in your > model. If you add the requires= bit to your "type" field, then > automatically web2py will turn that fi

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Niphlod
that's because web2py doesn't know what you expect to be filled in your model. If you add the requires= bit to your "type" field, then automatically web2py will turn that field into a SELECT with the correct options. On Sunday, October 7, 2012 9:01:48 PM UTC+2, dave wrote: > > ok I got it to d

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread dave
ok I got it to display using select() SELECT(_type='text', _name='test0', requires=IS_IN_DB(db, db.tiers.type, '%(type)s'))) now the problem is it wont populate the options of the dropdown box from the database On Sunday, October 7, 2012 7:33:54 AM UTC-7, Anthony wrote: > > There are two se

[web2py] Re: IS_IN_DB and IS_IN_SET dont work inside INPUT

2012-10-07 Thread Anthony
There are two separate issues -- the validation of the submitted values, and the widget displayed in the form to input the values. In your case, the validation should still work, but you won't get the widget because the widget is added by the SQLFORM __init__ method, which is called before you