我目前使用MultiCheckboxField这样一个复选框列表:如何延长CheckboxInput为
class MultiCheckboxField(SelectMultipleField):
"""
A multiple-select, except displays a list of checkboxes.
Iterating the field will produce subfields, allowing custom rendering of
the enclosed checkbox fields.
"""
widget = widgets.ListWidget(prefix_label=False)
option_widget = widgets.CheckboxInput()
生成复选框列表。我想以这样的方式扩展此列表,以允许某些列表条目具有关联的TextInput字段。当该框被选中时,相应的文本输入是必需的。
我是Flask和WTForms的新手,我在尝试弄清楚如何解决问题时遇到了一些麻烦。我会很感激任何可能提供某种方向的建议。