title: how can I update multiple record list from a form in Django 1.9
body: <p>I have a shipment_details form where have some information about shipment and all item in that order of the shipments. There is two model information one Shipment another is Items  model. I want to update all Marco Item Shipped value using the checkbox( see the form view pics). 
  here is my form view
  <a href="http://imgur.com/a/dcNZE" rel="nofollow">http://imgur.com/a/dcNZE</a>
  Here is my forms.py where I linked up checkbox to Items is_shipped field and this value show in the view using <code>{{form_status.as_p}}</code>.
  <strong>forms.py</strong></p>
  
  <pre><code>class ShipmentStatus(forms.CheckboxInput):
      input_type = 'checkbox'
  
  class ShipmentStatusForm((forms.ModelForm)):
      class Meta:
          model = Items
          fields = ['is_shipped']
          widgets = {
              'is_shipped': ShipmentStatus(),
          }
  </code></pre>
  
  <p>Here is my view model
  <strong>shipment_detail.html</strong></p>
  
  <pre><code>{% extends "_dashboardlayout.html" %}
  
  {% block content %}
  
  &lt;div id="page-wrapper"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-lg-12"&gt;
              &lt;h2 class="page-header"&gt;Shipment Details&lt;/h2&gt;
          &lt;/div&gt;
          &lt;div class="col-md-12"&gt;
              &lt;form method="POST" action=""&gt;
                  {% csrf_token %}
                  {{ form.as_p }}
                  &lt;table class="table table-striped"&gt;
                      &lt;tr&gt;
                          &lt;th&gt;Item No&lt;/th&gt;
                          &lt;th&gt;SKU&lt;/th&gt;
                          &lt;th&gt;Quantity&lt;/th&gt;
                          &lt;th&gt;Price&lt;/th&gt;
                          &lt;th&gt;Marco Item&lt;/th&gt;
                          &lt;th&gt;Marco Item Shipped&lt;/th&gt;
                      &lt;/tr&gt;
                      {% for item in items_queryset %}
                      &lt;tr&gt;
                          &lt;td&gt;{{ item.item_no }}&lt;/td&gt;
                          &lt;td&gt;{{ item.sku }}&lt;/td&gt;
                          &lt;td&gt;{{ item.requested_quantity }}&lt;/td&gt;
                          &lt;td&gt;{{ item.price }}&lt;/td&gt;
                          &lt;td&gt;{{ item.is_send }}&lt;/td&gt;
                          &lt;td&gt;{{ form_status.as_p }}&lt;/td&gt;
                      &lt;/tr&gt;
                      {% endfor %}
                  &lt;/table&gt;
                  &lt;input type="submit" value="Save"&gt;
              &lt;/form&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;!-- /.row --&gt;
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <p>Here is my control py file</p>
  
  <pre><code>def shipment_detail(request, order_id=None):
      order_queryset = Order.objects.get(order_id=order_id)
      customer_queryset = Customer.objects.all()
      address_queryset = Address.objects.all()
      items_queryset = Items.objects.filter(order_id=order_id).order_by('item_no')
      shipment_queryset = Shipment.objects.filter(order_id=order_id)
      # if there is no shipment data then generate shipment details for the Order
      if not shipment_queryset:
          form = ShipmentForm(request.POST or None)
          form_status = ShipmentStatusForm(request.POST or None)
          if form.is_valid():
              instance = form.save(commit=False)
              instance.order_id = order_queryset
              order_queryset.save()
              instance.save()
  
          # save item status
          if form_status.is_valid():
              instance = form_status.save(commit=False)
              instance.save()
  
          context = {
              "form": form,
              "form_status": form_status,
              "order_queryset": order_queryset,
              "customer_queryset": customer_queryset,
              "address_queryset": address_queryset,
              "items_queryset": items_queryset,
          }
          return render(request, "shipment_detail.html", context)
      # if there is already data then updated the shipment details for the Order
      else:
          instance = get_object_or_404(Shipment, order_id=order_id)
          form = ShipmentForm(request.POST or None, instance=instance)
  
          if form.is_valid():
              instance = form.save(commit=False)
              instance.order_id = order_queryset
              # updated order is_shipped field according to ship_status
              if instance.status == True:
                  order_queryset.is_shipped = True
  
              if instance.status == False:
                  order_queryset.is_shipped = False
  
              # updated order is_completed field according to shipment is_complete field
              if instance.is_complete == True:
                  order_queryset.is_completed = True
  
              if instance.is_complete == False:
                  order_queryset.is_completed = False
  
              order_queryset.save()
  
              instance.save()
  
          print "form  status"
  
          # updated item is_shipped field
          instance_status = get_list_or_404(Items, order_id=order_id)
  
          for instance in instance_status:
              form_status = ShipmentStatusForm(request.POST, instance=instance)
              if form_status.is_valid():
                  instance = form_status.save(commit=False)
                  instance.save()
  
          context = {
              "form": form,
              "instance": instance,
              "form_status": form_status,
              "order_queryset": order_queryset,
              "customer_queryset": customer_queryset,
              "address_queryset": address_queryset,
              "items_queryset": items_queryset,
          }
          return render(request, "shipment_detail.html", context)
  </code></pre>
  
  <p>Here problem is when click all the Marco Item Shipped true or false its save value properly but if I click one false another true then it doesn't save value.</p>