title: Forcing unique together with model inheritance
body: <p>I was trying to resolve the issue below, after some searching it seems to be an open <a href="https://code.djangoproject.com/ticket/16732" rel="noreferrer">bug</a> in Django. I resolved the issue by adding a classmethod to the model child, although this solution works, it still requires another custom check on any (Model)Form using this child class. I'm posting this for others to find a solution sooner than I did, other solutions are welcome too.</p>
  
  <pre><code>class Foo(models.Model):
      attr1 = models.IntegerField()
      attr2 = models.IntegerField()
  
      class Meta:
          unique_together = (
              ('attr1', 'attr2'),
          )
  
  
  class Bar(Foo):
      attr3 = models.IntegerField()
  
      class Meta:
          unique_together = (
              ('attr1', 'attr3'),
          )
  </code></pre>
  
  <p>raises:</p>
  
  <pre><code>Unhandled exception in thread started by &lt;bound method Command.inner_run of &lt;django.contrib.staticfiles.management.commands.runserver.Command object at 0x10f85a0d0&gt;&gt;
  Traceback (most recent call last):
    File "/Users/intelliadmin/VirtualEnvs/virtenv9/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
      self.validate(display_num_errors=True)
    File "/Users/intelliadmin/VirtualEnvs/virtenv9/lib/python2.7/site-packages/django/core/management/base.py", line 270, in validate
      raise CommandError("One or more models did not validate:\n%s" % error_text)
  django.core.management.base.CommandError: One or more models did not validate:
  app.Bar: "unique_together" refers to attr1. This is not in the same model as the unique_together statement.
  </code></pre>