How can WTForms RadioField generate html without <ul> and <li> tag?

倾然丶 夕夏残阳落幕 提交于 2021-01-28 19:18:54

问题


Are there any way to replace html tag on WTForms?

Form code:

class BasicForm(Form):
    some_select = RadioField("something", choices=[('first', 'first_choice'), ('second', 'second_choice')])

Thanks.


回答1:


Your field accepts a widget argument you can pass to override default widget(that renders your field).

Docs:

http://wtforms.simplecodes.com/docs/0.6/fields.html#wtforms.fields.Field



来源:https://stackoverflow.com/questions/31405666/how-can-wtforms-radiofield-generate-html-without-ul-and-li-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!