>
> Just IS_IN_DB. I think the only other one for which it might be relevant 
> is IS_IN_SET, but once you specify a specific set of items, you generally 
> wouldn't need to apply additional validators. Also, note that whether or 
> not you get the drop-down widget for IS_IN_DB and IS_IN_SET is just default 
> behavior -- you can always explicitly specify the widget for a given field:
>
> Field('myfield', requires=[IS_IN_SET(['a', 'b', 'c']), 
> some_other_validators], widget=SQLFORM.widgets.options.widget)
>
> Above, you still get the dropdown even though IS_IN_SET is in a list of 
> validators.
>

Ah, good to know.  The reason I needed a list of validators is because I 
have a form that requires either an email address or a phone number and 
carrier.  If they fill in the phone number, they must select a carrier.  So 
I want to have an extra validator on the carrier field of the form, 
IS_EXPR(str(request.vars.phone == '' or request.vars.carrier != 
''),error_message='please enter a carrier').  I'm side-stepping this 
problem right now by attaching this validator to the phone field, but now 
that I know how to specify a drop-down, I can do this better.

Reply via email to