title: validating a form dynamically built in flask
body: <p>I have a problem sending data in a form, which will not be the case. In the view, I build a dynamically form of agreement has some more complex models in the code is much simpler but the idea is the same.
  When I complete the form, this is never processed. I really do not know what may be the problem.</p>
  
  <p>code:</p>
  
  <pre><code>from wtforms import StringField,SubmitField
  from flask.ext.wtf import Form
  
  @preguntas.route('/pregunta/encuesta/', methods=['GET','POST'])
  def view():
      class F(Form):
           pass
  
      #building form
      setattr(F,'funcion1', StringField(label='fun1'))
      setattr(F,'funcion2', StringField(label='fun2'))
      setattr(F,'enviar', SubmitField('enviar formulario'))
  
      formulario = F()
  
      if formulario.validate_on_submit():
          #never comes to this part of the code
          print "saving data..."
  
  
      return render_template('pregunta/page.html',form = formulario)
  </code></pre>
  
  <p>thanks for your answers</p>