title: Can't Just Append A Delete Button To A Crispy Form
body: <p>I'm trying to create a fairly simple form that will allow me to update and delete instruments from a database. Everything is working except for HTML rendering, and for that I'm using django-crispy-forms.</p>
  
  <p>The following code works really well if all I want is a Submit button:</p>
  
  <p>forms.py</p>
  
  <pre><code>class InstrumentForm(forms.ModelForm):
      def __init__(self, *args, **kwargs):
          super(InstrumentForm, self).__init__(*args, **kwargs)
          self.helper = FormHelper()
          # Add a submit button after all of my fields are auto generated in the form.
          self.helper.add_input(Submit('submit', 'Submit'))
  
      class Meta:
          model = Instrument
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class InstrumentDetailView(generic.UpdateView):
      template_name = 'instrument/details.html'
      form_class = InstrumentForm
      # FIXME Don't hardcode the URL
      success_url = '/inventory/instruments'
      model = Instrument
  </code></pre>
  
  <p>instrument/details.html</p>
  
  <pre><code>{% extends "shared/base.html" %}
  {% load crispy_forms_tags %}
  
  {% block content %}
  &lt;h1&gt;Instrument Details&lt;/h1&gt;
  
  {% crispy form %}
  {% endblock %}
  </code></pre>
  
  <p>With this configuration, I see all of the fields from my Instrument model rendered perfectly with a Submit button that works.</p>
  
  <p>The problem is that I want to render a "Delete" link next to that Submit button. I've tried the following:</p>
  
  <p>forms.py</p>
  
  <pre><code>class InstrumentForm(forms.ModelForm):
      def __init__(self, *args, **kwargs):
          super(InstrumentForm, self).__init__(*args, **kwargs)
          self.helper = FormHelper()
          # Add a submit button after all of my fields are auto generated in the form.
          self.helper.add_input(Submit('submit', 'Submit'))
          self.helper.add_input(HTML('&lt;a href=foo&gt;foo&lt;/a&gt;'))
  
      class Meta:
          model = Instrument
  </code></pre>
  
  <p>But that just renders a button that looks like this:</p>
  
  <pre><code>&lt;input name="" value="" class="" id="-id-" type=""&gt;
  </code></pre>
  
  <p>So it looks like <code>add_input</code> only works for buttons. I then tried the following:</p>
  
  <p>forms.py</p>
  
  <pre><code>class InstrumentForm(forms.ModelForm):
      def __init__(self, *args, **kwargs):
          super(InstrumentForm, self).__init__(*args, **kwargs)
          self.helper = FormHelper()
  
          button_layout = Layout(
              ButtonHolder(
                 Submit('submit', 'Submit'),
                 HTML('&lt;a href="foo"&gt;foo&lt;/a&gt;')
              ),
          )
  
          self.helper.add_layout(button_layout)
  
      class Meta:
          model = Instrument
  </code></pre>
  
  <p>This does actually render my button and link properly, but all of the other fields disappear. I can of course fix this by manually specifying all of the fields in my InstrumentForm class, but I was hoping to avoid that code duplication.</p>
  
  <p>Does anyone know of a way to <strong>only append</strong> a submit button and arbitrary link to the bottom of an auto-generated form using django-crispy-form? What am I missing?</p>