title: Flask Form Only Passing First Item
body: <p>I am building a cart using Flask for learning purposes. I chose to use SQLite with peewee(ORM) and WTForms. I have it set to display the items from the db with a description and image. I have a form that asks for the quantity then it should add the item and its quantity to the side bar. </p>
  
  <p><strong>The Issue</strong></p>
  
  <p>When You enter a quantity and hit 'add' all the quantity fields will fill with that number and it will post the name of the first item from the database to the sidebar with that quantity.</p>
  
  <p><strong>app.py</strong></p>
  
  <pre><code>@app.route('/cart', methods=['GET', 'POST'])
  @login_required
  def cart():
      form = forms.PartsSelectForm()
      if request.method == 'POST':
          l_name = Parts.get(Parts.id).part_name
          models.List.create(l_part_name=l_name,
                             l_part_qty=form.quantity.data)
      parts = Parts.select()
      list = List.select()
      return render_template('cart.html', parts=parts, list=list, form=form)
  </code></pre>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>class PartsSelectForm(Form):
      quantity = IntegerField()
  </code></pre>
  
  <p><strong>cart.html</strong></p>
  
  <pre><code>&lt;table class="table"&gt;
              &lt;thead&gt;
              &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Image&lt;/th&gt;
              &lt;th&gt;Quantity&lt;/th&gt;
              &lt;th&gt;Action&lt;/th&gt;
              &lt;/tr&gt;
              &lt;/thead&gt;
  
              {% for part in parts %}
              &lt;tr&gt;
                  &lt;td&gt;{{ part.part_name }}&lt;/td&gt;
                  &lt;td&gt;{{ part.part_desc }}&lt;/td&gt;
                  &lt;td style="width: 200px; height:200px;"&gt;&lt;img src="/static/img/{{ part.part_img }}" style="max-height:100%; max-width:100%"&gt;&lt;/td&gt;
                  &lt;form method="POST" action=""&gt;
                      &lt;td&gt;{{ form.quantity }}&lt;/td&gt;
  
                  &lt;td&gt;&lt;button type="submit" id="submit" class="btn btn-success"&gt;Add&lt;/button&gt;&lt;/td&gt;
  &lt;/form&gt;
              &lt;/tr&gt;
              {% endfor %}
          &lt;/table&gt;
  </code></pre>