From 58c1a67ff1504d9368eb55461095f3a805b97ea7 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 23 Apr 2010 14:30:29 +0000 Subject: [1.1.X] Fixed #11764 -- Added a missing set of parentheses in a call calculating the select_related tables. Thanks to aurelio for the report and original patch, and wogan for the updated patch. Backport of r13019 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@13020 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/model_inheritance_regress/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/regressiontests/model_inheritance_regress/models.py b/tests/regressiontests/model_inheritance_regress/models.py index a1ee6a2d86..f31fc3d926 100644 --- a/tests/regressiontests/model_inheritance_regress/models.py +++ b/tests/regressiontests/model_inheritance_regress/models.py @@ -56,6 +56,9 @@ class ParkingLot3(Place): class Supplier(models.Model): restaurant = models.ForeignKey(Restaurant) +class Wholesaler(Supplier): + retailer = models.ForeignKey(Supplier,related_name='wholesale_supplier') + class Parent(models.Model): created = models.DateTimeField(default=datetime.datetime.now) @@ -238,6 +241,10 @@ True >>> Supplier.objects.filter(restaurant=Restaurant(name='xx', address='yy')) [] +# Regression test for #11764. +>>> for w in Wholesaler.objects.all().select_related(): +... print w + # Regression test for #7853 # If the parent class has a self-referential link, make sure that any updates # to that link via the child update the right table. -- cgit v1.3