title: Django form with unknown number of checkbox fields and multiple actions
body: <p>I need help with form which looks like a Gmail inbox and have multiple actions. There is a list of items and I want to wrap it with form, on the way that every item have checkbox in the front of the line. So when user select few items he is able to click on two buttons with different actions for example delete and mark read.</p>
  
  <pre><code>&lt;form action=""&gt;
      {% for item in object_list %}
      &lt;input type="checkbox" id="item.id"&gt;
      {{ item.name }}
      {% endfor %}
      &lt;button type="submit" name="delete"&gt;Delete&lt;/button&gt;
      &lt;button type="submit" name="mark_read"&gt;Mark read&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I can find which submit button is user click on if use <code>if 'delete' in request.POST</code> but I cant refer to any form because Django form cant be defined with unknown number of fields as I think. So how can I process selected items in view?</p>
  
  <pre><code>if request.method == 'POST':
      form = UnknownForm(request.POST):
      if 'delete' in request.POST:
          'delete selected items'
      if 'mark_read' in erquest.POST:
          'mark selected items as read'
      return HttpResponseRedirect('')
  </code></pre>