Ticket #11764: 11764.2.diff

File 11764.2.diff, 1.7 KB (added by Greg Wogan-Browne, 15 years ago)

Updated patch against rev12438

  • django/db/models/sql/compiler.py

     
    556556                    lhs_col = int_opts.parents[int_model].column
    557557                    dedupe = lhs_col in opts.duplicate_targets
    558558                    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                                ()))
    561561                        dupe_set.add((opts, lhs_col))
    562562                    int_opts = int_model._meta
    563563                    alias = self.query.join((alias, int_opts.db_table, lhs_col,
  • tests/regressiontests/model_inheritance_regress/models.py

     
    5656class Supplier(models.Model):
    5757    restaurant = models.ForeignKey(Restaurant)
    5858
     59class WholesaleSupplier(Supplier):
     60    owned_retailer = models.ForeignKey(Supplier, related_name='partner_supplier')
     61
    5962class Parent(models.Model):
    6063    created = models.DateTimeField(default=datetime.datetime.now)
    6164
     
    385388>>> p4.bachelorparty_set.all()
    386389[<BachelorParty: Bachelor party for Bob>, <BachelorParty: Bachelor party for Dave>]
    387390
     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
    388398"""}
    389399
Back to Top