Fixed #17519 -- Fixed missing SQL constraints to proxy models.

Thanks thibaultj for the report, jenh for the patch,
and charettes for the tests.
This commit is contained in:
Tim Graham 2013-08-01 14:09:47 -04:00
parent 31ee120787
commit aa830009de
3 changed files with 37 additions and 11 deletions

View file

@ -68,11 +68,18 @@ class Reporter(models.Model):
return "%s %s" % (self.first_name, self.last_name)
class ReporterProxy(Reporter):
class Meta:
proxy = True
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100)
pub_date = models.DateField()
reporter = models.ForeignKey(Reporter)
reporter_proxy = models.ForeignKey(ReporterProxy, null=True,
related_name='reporter_proxy')
def __str__(self):
return self.headline