thanks guys...its working.... :)

On Tue, Jun 2, 2009 at 7:59 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:

>
> or
>
>   db.Field('gender', requires = IS_IN_SET(
>     ['male', 'female'],['Handsome man','Pretty woman']))
>
> to preserve order.
>
> Notice that 'gender' is more appropriate than 'sex'.
>
> Massimo
>
> On Jun 2, 7:55 am, Iceberg <iceb...@21cn.com> wrote:
> > You can also try this:
> >
> >   db.Field('sex', requires = IS_IN_SET(
> >     {'male':'Handsome man', 'female':'Pretty woman'}
> >     ))
> >
> > On Jun2, 8:24pm, Mladen Milankovic <mml...@gmail.com> wrote:
> >
> > > Hi.
> >
> > > You don't need the [] brackets.
> > > use:
> > > db.define_table('user',
> > >     db.Field('sex', requires = IS_IN_SET(['male', 'female'])))
> >
> > > regards
> > > mmlado
> >
> > > On Tuesday 02 June 2009 13:39:35 durga wrote:
> >
> > > > hi
> >
> > > > I would like create a form through SQLFORM in which one of my field
> to
> > > > be generated as  combo box. for example i have options male/female
> for
> > > > a sex field. How do i write code for this.
> >
> > > > db.define_table('users',
> > > >                 SQLField('sex',requires=[IS_IN_SET
> > > > (['male','female'])])
> >
> > > > thanks in advance
> >
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to