title: How to label a form instance within a django inline formset?
body: <p>I have what I think is a common enough situation, but can't seem to get my head around it.  I've used the <code>django.forms.inlineformset_factory</code> to create a formset of forms which allow the user to alter aspects of a foreign key object, and these are working fine.</p>
  
  <p>The trouble is that I want to be able to label each of these forms within the formset (note, not fields within each form, but the foreign key model on which each form is based).  For example, if I tweak the example in the docs:</p>
  
  <pre><code>from django.db import models
  from django.forms import inlineformset_factory
  
  class Author(models.Model):
      name = models.CharField(max_length=100)
  
  class Book(models.Model):
      author = models.ForeignKey(Author, on_delete=models.CASCADE)
      title = models.CharField(max_length=100)
      pages = models.IntegerField(default=0)
  </code></pre>
  
  <p>I create my formset to allow people to change the number of pages in any book by Daffy Duck:</p>
  
  <pre><code>BookFormSet = inlineformset_factory(Author, Book, fields=('pages',))
  author = Author.objects.get(name='Daffy Duck')
  formset = BookFormSet(instance=author)
  </code></pre>
  
  <p>Say Daffy has written five books, these show up as integer entries all labelled "Pages", with no reference to which book each points to.  How can I label the form with the title of the book so that they know which one they're changing?  I've tried passing a dictionary to the <code>labels</code> field of the <code>inlineformset_factory</code> function, but it didn't work.  </p>