title: How to use Django model inheritance with signals?
body: <p>I have a few model inheritance levels in Django:</p>
  
  <pre><code>class WorkAttachment(models.Model):
      """ Abstract class that holds all fields that are required in each attachment """
      work            = models.ForeignKey(Work)
      added           = models.DateTimeField(default=datetime.datetime.now)
      views           = models.IntegerField(default=0)
  
      class Meta:
          abstract = True
  
  
  class WorkAttachmentFileBased(WorkAttachment):
      """ Another base class, but for file based attachments """
      description     = models.CharField(max_length=500, blank=True)
      size            = models.IntegerField(verbose_name=_('size in bytes'))
  
      class Meta:
          abstract = True
  
  
  class WorkAttachmentPicture(WorkAttachmentFileBased):
      """ Picture attached to work """
      image           = models.ImageField(upload_to='works/images', width_field='width', height_field='height')
      width           = models.IntegerField()
      height          = models.IntegerField()
  </code></pre>
  
  <p>There are many different models inherited from <code>WorkAttachmentFileBased</code> and <code>WorkAttachment</code>. I want to create a signal, which would update an <code>attachment_count</code> field for parent work, when attachment is created. It would be logical, to think that signal made for parent sender (<code>WorkAttachment</code>) would run for all inherited models too, but it does not. Here is my code:</p>
  
  <pre><code>@receiver(post_save, sender=WorkAttachment, dispatch_uid="att_post_save")
  def update_attachment_count_on_save(sender, instance, **kwargs):
      """ Update file count for work when attachment was saved."""
      instance.work.attachment_count += 1
      instance.work.save()
  </code></pre>
  
  <p>Is there a way to make this signal work for all models inherited from <code>WorkAttachment</code>?</p>
  
  <p>Python 2.7, Django 1.4 pre-alpha</p>
  
  <p>P.S. I've tried <a href="http://groups.google.com/group/django-users/browse_thread/thread/13fbbda47224888d" rel="noreferrer">one of the solutions I found on the net</a>, but it did not work for me.</p>