开发者

web2py - display radio button into my form

开发者 https://www.devze.com 2022-12-11 17:06 出处:网络
i want开发者_如何转开发 to display a radio button into my from so i did: SQLField(\'active\',requires=IS_IN_SET((\'True\',\'False\')),widget=SQLFORM.widgets.radio.widget)

i want开发者_如何转开发 to display a radio button into my from so i did:

 SQLField('active',requires=IS_IN_SET(('True','False')),widget=SQLFORM.widgets.radio.widget)

but it display an error:

AttributeError: 'NoneType' object has no attribute 'widget'

So how can fix it??

Is there any solution to display radio buttons into my from?? Thanks in advance

Neveen Adel


You might want to try

SQLField('active',requires=IS_IN_SET(['True','False']),widget=SQLFORM.widgets.radio.widget)

That works for me.


You may be running a very old web2py version. Please bring this up on the web2py mailing list.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号