title: getting data from wtforms FormField in a Flask route
body: <p>I have a problem getting data from a form using it in a route</p>
  
  <p><strong><em>forms.py</em></strong></p>
  
  <pre><code>class Calculator(Form):
      amount = IntegerField('Amount')
      weight = IntegerField('Weight')
  
  class Program(Form):
      cycles = IntegerField('Cycles')
      volume = FormField(Calculator)
  </code></pre>
  
  <p><strong><em>app.py</em></strong></p>
  
  <pre><code>@app.route('/', methods=('GET', 'POST'))
  def index():
      form = forms.Program()
      if form.validate_on_submit():
          values = models.Progression(
              cycles=form.cycles.data,
              amount=form.amount.data,
              weight=form.weight.data
          )
      return render_template('index.html', form=form, values=values)
  </code></pre>
  
  <p>The data for <code>cycles</code> comes through just fine  but I am unsure of the syntax for how to access the encapsulated form within my route. The docs say <code>FormField</code> will return the data dict of the enclosed form but I can't seem to figure out how to grab that and put it in a variable.</p>