title: How can I create a custom template for a TabularInline admin Formset in Django?
body: <p>In my Django app (research database), when changing a person object in the admin, I'd like all of the sources for that person to be listed as hyperlinks to the file for that source. I'm trying to do this by creating a custom template for a stacked inline. Here is the custom template so far:</p>
  
  <pre><code>&lt;p&gt;Testing&lt;/p&gt;
  
  {% for form in inline_admin_formset %}
      {% for fieldset in form %} 
          &lt;h5&gt;Fieldset&lt;/h5&gt;
          {% if fieldset.name %} &lt;h2&gt;{{ fieldset.name }}&lt;/h2&gt;{% endif %}
          {% for line in fieldset %} 
              &lt;h6&gt;Line&lt;/h6&gt;
              {% for field in line %} 
                  &lt;h6&gt;Field&lt;/h6&gt;
                  {{ field.field }}       
              {% endfor %}
          {% endfor %}
      {% endfor %} 
  {% endfor %}
  </code></pre>
  
  <p>A lot of this is just for me to see what's going on. I used the links <a href="https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/edit_inline/stacked.html#L6http://" rel="nofollow noreferrer">here</a> and <a href="https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/includes/fieldset.html" rel="nofollow noreferrer">here</a> as sort of a guide. What renders from the <code>{{ field.field }}</code> is what you'd expect from an inline element - a dropdown menu with the source names as choices and some icons for adding/changing. </p>
  
  <p><a href="https://i.stack.imgur.com/ARU4a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ARU4a.png" alt="For clarity."></a></p>
  
  <p>What I really want, however, is just the source name rendered as a hyperlink. How do I get the source name (the actual name of the attribute is <code>source_name</code>) from what I have in the Django template language (i.e. the "field" object)?</p>