Ticket #11764: 11764.2.diff
File 11764.2.diff, 1.7 KB (added by , 15 years ago) |
---|
-
django/db/models/sql/compiler.py
556 556 lhs_col = int_opts.parents[int_model].column 557 557 dedupe = lhs_col in opts.duplicate_targets 558 558 if dedupe: 559 avoid.update(self.query.dupe_avoidance.get( id(opts), lhs_col),560 ()) 559 avoid.update(self.query.dupe_avoidance.get((id(opts), lhs_col), 560 ())) 561 561 dupe_set.add((opts, lhs_col)) 562 562 int_opts = int_model._meta 563 563 alias = self.query.join((alias, int_opts.db_table, lhs_col, -
tests/regressiontests/model_inheritance_regress/models.py
56 56 class Supplier(models.Model): 57 57 restaurant = models.ForeignKey(Restaurant) 58 58 59 class WholesaleSupplier(Supplier): 60 owned_retailer = models.ForeignKey(Supplier, related_name='partner_supplier') 61 59 62 class Parent(models.Model): 60 63 created = models.DateTimeField(default=datetime.datetime.now) 61 64 … … 385 388 >>> p4.bachelorparty_set.all() 386 389 [<BachelorParty: Bachelor party for Bob>, <BachelorParty: Bachelor party for Dave>] 387 390 391 # Regression tests for #11764 392 393 >>> qs = WholesaleSupplier.objects.all() 394 >>> qs = qs.select_related() 395 >>> for x in qs: 396 ... print x 397 388 398 """} 389 399