Ticket #11764: 11764.patch
File 11764.patch, 1.8 KB (added by , 15 years ago) |
---|
-
django/db/models/sql/compiler.py
546 546 lhs_col = int_opts.parents[int_model].column 547 547 dedupe = lhs_col in opts.duplicate_targets 548 548 if dedupe: 549 avoid.update(self.query.dupe_avoidance.get( id(opts), lhs_col),550 ()) 549 avoid.update(self.query.dupe_avoidance.get((id(opts), lhs_col), 550 ())) 551 551 dupe_set.add((opts, lhs_col)) 552 552 int_opts = int_model._meta 553 553 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 Wholesaler(Supplier): 60 retailer = models.ForeignKey(Supplier,related_name='wholesale_supplier') 61 59 62 class Parent(models.Model): 60 63 created = models.DateTimeField(default=datetime.datetime.now) 61 64 … … 268 271 >>> Supplier.objects.filter(restaurant=Restaurant(name='xx', address='yy')) 269 272 [] 270 273 274 # Regression test for #11764. 275 >>> for w in Wholesaler.objects.all().select_related(): 276 ... print w 277 271 278 # Regression test for #7853 272 279 # If the parent class has a self-referential link, make sure that any updates 273 280 # to that link via the child update the right table.