diff -r e7c74204f8f8 django/db/models/sql/query.py
a
|
b
|
|
1397 | 1397 | lhs_col = int_opts.parents[int_model].column |
1398 | 1398 | dedupe = lhs_col in opts.duplicate_targets |
1399 | 1399 | if dedupe: |
1400 | | avoid.update(self.dupe_avoidance.get(id(opts), lhs_col), |
1401 | | ()) |
| 1400 | avoid.update(self.dupe_avoidance.get((id(opts), lhs_col), |
| 1401 | ())) |
1402 | 1402 | dupe_set.add((opts, lhs_col)) |
1403 | 1403 | int_opts = int_model._meta |
1404 | 1404 | alias = self.join((alias, int_opts.db_table, lhs_col, |
diff -r e7c74204f8f8 tests/regressiontests/model_inheritance_regress/models.py
a
|
b
|
|
55 | 55 | |
56 | 56 | class Supplier(models.Model): |
57 | 57 | restaurant = models.ForeignKey(Restaurant) |
| 58 | |
| 59 | class WholesaleSupplier(Supplier): |
| 60 | owned_retailer = models.ForeignKey(Supplier, related_name='partner_supplier') |
58 | 61 | |
59 | 62 | class Parent(models.Model): |
60 | 63 | created = models.DateTimeField(default=datetime.datetime.now) |
… |
… |
|
318 | 321 | >>> ParkingLot3._meta.get_ancestor_link(Place).name # the child->parent link |
319 | 322 | "parent" |
320 | 323 | |
| 324 | # Regression tests for #11764 |
| 325 | |
| 326 | >>> qs = WholesaleSupplier.objects.all() |
| 327 | >>> qs = qs.select_related() |
| 328 | >>> for x in qs: |
| 329 | ... print x |
| 330 | |
321 | 331 | """} |
322 | 332 | |