gpt4 book ai didi

python - WTForms RadioField 如何在没有
  • 标签的情况下生成 html?

转载 作者:太空宇宙 更新时间:2023-11-03 17:34:27 26 4
gpt4 key购买 nike

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

表单代码:

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

谢谢。

最佳答案

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

文档:

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

关于python - WTForms RadioField 如何在没有 <ul> 和 <li> 标签的情况下生成 html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31405666/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com