title: django formset template loop through fields disables delete featuer
body: <p>Thank you for being here.</p>
  <p>I am not able to delete objects in django formset While i am looping through the fields in templates the.</p>
  <p>I can see the deletion box but when i hit submit the page refreshes and the object is  exist.</p>
  <p>template.html</p>
  <pre><code>   {%  for form in  request_equipment_form %}
             &lt;div class=&quot;card&quot; style=&quot;width: 100% &quot;&gt;
      &lt;div class=&quot;card-body&quot;&gt;
  
            &lt;div class=&quot;d-flex flex-row&quot; style=&quot;width:100%&quot;&gt;
                                {{form.equipment}}
                                {{form.quantity}}
                                {{form.DELETE}}
                                {{form.ORDER}}
             &lt;/div&gt;
                   &lt;/div&gt;
  </code></pre>
    
  <pre><code>     {% endfor %}
  </code></pre>
  <p>But when i do not loop through the fields the delete feature works like charm</p>
  <pre><code>   {%  for form in  request_equipment_form %}
             &lt;div class=&quot;card&quot; style=&quot;width: 100% &quot;&gt;
      &lt;div class=&quot;card-body&quot;&gt;
  
            &lt;div class=&quot;d-flex flex-row&quot; style=&quot;width:100%&quot;&gt;
                                {{form.as_p}}
             &lt;/div&gt;
                   &lt;/div&gt;
  </code></pre>
    
  <pre><code>     {% endfor %}
  </code></pre>
  <p>views.py</p>
  <pre><code>if formset.is_valid():
      instances = formset.save(commit=False)
      for d_obj in formset.deleted_objects:
          d_obj.delete()
      if not instances:
          return redirect(request.META.get('HTTP_REFERER'))
      for instance in instances:
          instance.user = request.user
          instance.flight = flight
          instance.station = flight.station
          instances = formset.save(commit=False)
          for instance in instances:
              instance.save()
              print(instance.date)
              return redirect(request.META.get('HTTP_REFERER'))
  </code></pre>