Example:

from gluon.sqlhtml import CheckboxesWidget, RadioWidget
db.define_table('test',  SQLField('field1'),  SQLField('field2'))

db.test.field1.requires=IS_IN_SET(('a','b','c'))
db.test.field1.widget = RadioWidget.widget

db.test.field2.requires=IS_IN_SET(('a','b','c'),multiple=True)
db.test.field2.widget = CheckboxesWidget.widget

def test():
    from gluon.sqlhtml import form_factory
    msg_form=SQLFORM(db.test,request.args(0))
    if msg_form.accepts(request.vars,session):
        redirect(URL(r=request,args=1))
    return dict(form=msg_form)

--~--~---------~--~----~------------~-------~--~----~
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