WTForms RadioField如何在没有< ul>的情况下生成html.和< li>标签? [英] How can WTForms RadioField generate html without <ul> and <li> tag?

查看:85
本文介绍了WTForms RadioField如何在没有< ul>的情况下生成html.和< li>标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以替换WTForms上的html标签吗?

Are there any way to replace html tag on WTForms?

表单代码:

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

谢谢.

推荐答案

您的字段接受一个widget参数,您可以传递该参数来覆盖默认的小部件(呈现您的字段).

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

文档:

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

这篇关于WTForms RadioField如何在没有< ul>的情况下生成html.和< li>标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆