So for future reference:
you can create OPTGROUPs with TAG.OPTGROUP
but do NOT use it with the SELECT helper,
you must use TAG.SELECT as in the following example:
def index():
OG=TAG.OPTGROUP
g1=[ OPTION( r.name, _value=r.id ) for r in
db(db.person.age<=30).select() ]
g2=[ OPTION( r.name, _value=r.id ) for r in
db(db.person.age>30).select() ]
ogs=[OG(_label='30 and under',*g1),OG(_label='over 30',*g2)]
sel = TAG.SELECT(_name='person', *ogs)
# DO NOT USE sel=SELECT(_name='person',*ogs )
f=FORM( sel )
return dict(f=f)
Denes.
--
You received this message because you are subscribed to the Google Groups
"web2py-users" 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.