wtforms, generate fields in constructor
问题 I need to generate my fields in the constructor of the form since the number of fields needed can vary. I think my current solution is the problem. I get an exception when I try to expand the form in my template saying AttributeError: 'UnboundField' object has no attribute ' call ' What is wrong with this code? class DriverTemplateSchedueForm(Form): def __init__(self, per_day=30, **kwargs): self.per_day = per_day ages = model.Agency.query.all() ages = [(a.id, a.name) for a in ages] self.days