1
0
mirror of https://github.com/django/django.git synced 2025-10-26 23:26:08 +00:00

[1.6.x] Fixed #21413 -- resolve_columns fields misalignment

Backpatch of 9918c11114 from master.

Conflicts:

	django/db/models/sql/compiler.py
	tests/model_inheritance_regress/tests.py
This commit is contained in:
Anssi Kääriäinen
2013-11-17 15:50:14 +02:00
parent 5f42c02195
commit 0f272629ca
3 changed files with 15 additions and 8 deletions

View File

@@ -441,3 +441,9 @@ class ModelInheritanceTest(TestCase):
# used in the qs and top contains direct pointer to the bottom model.
qs = ItalianRestaurant.objects.values_list('serves_gnocchi').filter(name='foo')
self.assertEqual(str(qs.query).count('JOIN'), 1)
def test_inheritance_resolve_columns(self):
Restaurant.objects.create(name='Bobs Cafe', address="Somewhere",
serves_pizza=True, serves_hot_dogs=True)
p = Place.objects.all().select_related('restaurant')[0]
self.assertIsInstance(p.restaurant.serves_pizza, bool)