summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-04 05:35:01 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2009-04-04 05:35:01 +0000
commit2b1934ff3c3f80f58cc35bdcc03ae1b0ea6eb17e (patch)
treece6043947d92f23916324a83a65e340d69148ec8 /tests
parent0a89a57ffc491f2d1ff9a19e792739f67a945be3 (diff)
Fixed a problem when computing deferred fields on multiple related models.
Fixed #10710, as this fixes the second bug reported there. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10384 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/defer_regress/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/regressiontests/defer_regress/models.py b/tests/regressiontests/defer_regress/models.py
index d7ba713061..e2a5944f92 100644
--- a/tests/regressiontests/defer_regress/models.py
+++ b/tests/regressiontests/defer_regress/models.py
@@ -24,6 +24,7 @@ class Child(models.Model):
class Leaf(models.Model):
name = models.CharField(max_length=10)
child = models.ForeignKey(Child)
+ second_child = models.ForeignKey(Child, related_name="other", null=True)
value = models.IntegerField(default=42)
def __unicode__(self):
@@ -87,6 +88,8 @@ Some further checks for select_related() and inherited model behaviour
>>> obj = Leaf.objects.only("name", "child").select_related()[0]
>>> obj.child.name
u'c1'
+>>> Leaf.objects.select_related().only("child__name", "second_child__name")
+[<Leaf_Deferred_name_value: l1>]
"""
}