title: Django Formset Delete Field Not Showing
body: <p>I need to manually render my formset in my template and I cannot get the delete checkbox field into the template when I render manually.  However, it does show when I render {{form.as_table}}.</p>
  
  <p>views.py</p>
  
  <pre><code>QuoteManifestForm= modelformset_factory(QuoteManifest, QManifestForm, can_delete = True)
  </code></pre>
  
  <p>template - this does not display the <code>{{form.DELETE}}</code> but every other field shows fine, including id which I can see in the DOM. </p>
  
  <pre><code>{{ manifest.management_form }} &lt;--!I passed QuoteManifestForm to template as 'manifest'--&gt;
  
            {% for form in manifest.forms %}
              &lt;div id="form_set"&gt;
                  &lt;table id = 'manifest-table25' class="manifest-table2" width=100%&gt;
                    {% csrf_token %}
                    &lt;tbody width=100%&gt;
                      &lt;tr class="manifest-row"&gt;
                        &lt;td width = 17.5% class="productCode" onchange="populateProduct(this)"&gt;{{form.ProductCode}}&lt;/td&gt;
                        &lt;td width = 32.5% class="description"&gt;{{form.DescriptionOfGoods}}&lt;/td&gt;
                        &lt;td width = 12.5% class="quantity" oninput="calculateUnit(this)"&gt;{{form.UnitQty}}&lt;/td&gt;
                        &lt;td width = 12.5% class="unitType"&gt;{{form.Type}}&lt;/td&gt;
                        &lt;td width = 12.5% class="price" oninput="calculate(this)"&gt;{{form.Price}}&lt;/td&gt;
                        &lt;td width = 12.5% class="amount2"&gt;{{form.Amount}}&lt;/td&gt;
                        &lt;td&gt;{{form.DELETE}}&lt;/td&gt;
                        {{form.id}}
                      &lt;/tr&gt;
                    &lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
              {% endfor %}
  </code></pre>
  
  <p>Any idea why that is not working?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I found in the django docs that if you are rendering manually, you should include something like the below in your form.  I tried this, but still no Delete field appears in my template: </p>
  
  <pre><code>{% if form2.can_delete %}
    &lt;td&gt; {{form.DELETE}}&lt;/td&gt;
  {% endif %}
  </code></pre>
  
  <p><strong>CODE TO REPRODUCE</strong></p>
  
  <p>views.py</p>
  
  <pre><code>def QuoteView(request):
      QuoteManifestForm= modelformset_factory(QuoteManifest, fields =('ProductCode', 'DescriptionOfGoods', 'UnitQty', 'Type','Amount', 'Price'), can_delete = True)
      if request.method == "POST":
         form2 = QuoteManifestForm(request.POST)
         form2.save()
  
         return redirect('HomeView')
  
      else:
         form2 = QuoteManifestForm()
          context = {
  
              'form2': form2,
  
          }
          return render(request, 'quote.html', context)
  </code></pre>
  
  <p>quote.html</p>
  
  <pre><code>{{ form2.management_form }}
              &lt;div id="form_set"&gt;
                {% for form2 in form2.forms %}
                  &lt;table id = 'manifest-table25' class="manifest-table2" width=100%&gt;
                    {% csrf_token %}
                    &lt;tbody width=100%&gt;
                      &lt;tr class="manifest-row"&gt;
                        &lt;td width = 17.5% class="productCode" onchange="populateProduct(this)"&gt;{{form2.ProductCode}}&lt;/td&gt;
                        &lt;td width = 32.5% class="description"&gt;{{form2.DescriptionOfGoods}}&lt;/td&gt;
                        &lt;td width = 12.5% class="quantity" oninput="calculateUnit(this)"&gt;{{form2.UnitQty}}&lt;/td&gt;
                        &lt;td width = 12.5% class="unitType"&gt;{{form2.Type}}&lt;/td&gt;
                        &lt;td width = 10.5% class="price" oninput="calculate(this)"&gt;{{form2.Price}}&lt;/td&gt;
                        &lt;td width = 12.5% class="amount2"&gt;{{form2.Amount}}&lt;/td&gt;
                        &lt;td&gt;{{form2.DELETE}}&lt;/td&gt;
                        {{form2.id}}
                      &lt;/tr&gt;
                    &lt;/tbody&gt;
                  &lt;/table&gt;
                {% endfor %}
              &lt;/div&gt;
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class QuoteManifest(models.Model):
      ProductCode = models.ForeignKey(Product, null=True, blank=True)
      DescriptionOfGoods = models.CharField(max_length=500, blank=True)
      UnitQty = models.CharField(max_length=10, blank=True)
      Type = models.CharField(max_length=50, blank=True)
      Amount = models.CharField(max_length=100, blank=True)
      Price = models.CharField(max_length=100, blank=True)
  </code></pre>
  
  <p>{{form2.DELETE}} is supposed to render a checkbox.  This is what I cannot get working.  It does work when I render the form as {{form2.as_p}} but that will not work for me in my case.</p>