From 196cc875b26f266e8f8dfd5be9daa0b8f246b9cd Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 1 Aug 2013 14:09:47 -0400 Subject: [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 --- tests/backends/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/backends/models.py') diff --git a/tests/backends/models.py b/tests/backends/models.py index 4f03ddeacc..1508af4354 100644 --- a/tests/backends/models.py +++ b/tests/backends/models.py @@ -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 -- cgit v1.3