title: Django Many to Many Inline - how to show fields referenced by through model?
body: <p>I'm trying to customize and many to many inline in the django Admin, but I'm not able to display the fields of the underlying models.</p>
  
  <p>Here's a simplified example.  Maybe you can tell me how to reference them?</p>
  
  <p>Here are my models:</p>
  
  <pre><code>class Clown(models.Model):
      name = models.CharField(max_length=255)
      def edit_link(self):
          return ...
  
  class Circus(models.Model):
      clowns = models.ManyToManyField(Clown, blank=True, through='WorkedAt')
      name = models.CharField(max_length=255)
  
  class WorkedAt(models.Model):
      clown = models.ForeignKey(Clown)
      circus = models.ForeignKey(Circus)
  </code></pre>
  
  <p>and my admin:</p>
  
  <pre><code>class ClownInline(admin.TabularInline):
      model = WorkedAt
      fields = ['clown__name','clown__edit_link']
  
  
  class CircusAdmin(admin.ModelAdmin):
      inlines = [
          ClownInline,
      ]
      exclude = ('clowns',)
  </code></pre>
  
  <p>However I get this error:</p>
  
  <pre><code>Unknown field(s) (clown__name) specified for WorkedAt
  </code></pre>
  
  <p>(I'm on Django 1.6)</p>
  
  <p><strong>Update:</strong> 
  Why won't this work either.  (Added calculated field to through model.)</p>
  
  <pre><code>class Clown(models.Model):
      name = models.CharField(max_length=255)
      def edit_link(self):
          return ...
  
  class Circus(models.Model):
      clowns = models.ManyToManyField(Clown, blank=True, through='WorkedAt')
      name = models.CharField(max_length=255)
  
  class WorkedAt(models.Model):
      clown = models.ForeignKey(Clown)
      circus = models.ForeignKey(Circus)
      @property
      def edit_link(self):
          return self.clown.edit_link()
  </code></pre>
  
  <p>and my admin:</p>
  
  <pre><code>class ClownInline(admin.TabularInline):
      model = WorkedAt
      fields = ['edit_link']
  
  
  class CircusAdmin(admin.ModelAdmin):
      inlines = [
          ClownInline,
      ]
      exclude = ('clowns',)
  </code></pre>