1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

[1.6.x] Fixed #17519 -- Fixed missing SQL constraints to proxy models.

Thanks thibaultj for the report, jenh for the patch,
and charettes for the tests.

Backport of aa830009de from master
This commit is contained in:
Tim Graham
2013-08-01 14:09:47 -04:00
parent b3e54f4a01
commit 196cc875b2
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