This is intentional. It gives you an option.
On Oct 12, 7:23 am, billf <[EMAIL PROTECTED]> wrote:
> It seems the problem is that IS_IN_SET cannot be in a list.
>
> Although there is no specific example of [IS_IN_SET(['Y','N'])], there
> are examples that group several validators together in a list and also
> [IS_NOT_EMPTY] (one validator in a ) so it seems a bit perverse
> that if IS_IN_SET is in a list it just gets ignored.
>
> Bill
>
> On Oct 12, 9:19 am, billf <[EMAIL PROTECTED]> wrote:
>
> > My model contains:
> > db.define_table('recipe',
>
> > SQLField('last_action_ts','datetime',required=True,default=now),
>
> > SQLField('ability','string',length=1,required=True,requires=IS_IN_SET(['B','C'],labels=['straightforward','slightly
> > adventurous'])),
> > SQLField('amount','integer',required=True),
> > ...
> > migrate=False)
>
> > My controller contains form=SQLFORM(db.recipe)
>
> > My view contains {{=form}}
>
> > But the displayed form has an INPUT type="text" for ability, shouldn't
> > it be a SELECT?
>
> > Looking into it, it seems the SQLFORM __init__ contains "elif
> > hasattr(field.requires,'options'):" which must be true to create the
> > SELECT and this is False for the "ability" field.
>
> > I'm sure I'm doing something silly but I can't see it. Any ideas
> > please?
>
> > Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---