WTForms create variable number of fields
问题 How I would dynamically create a few form fields with different questions, but the same answers? from wtforms import Form, RadioField from wtforms.validators import Required class VariableForm(Form): def __init__(formdata=None, obj=None, prefix='', **kwargs): super(VariableForm, self).__init__(formdata, obj, prefix, **kwargs) questions = kwargs['questions'] // How to to dynamically create three questions formatted as below? question = RadioField( # question ?, [Required()], choices = [('yes',