summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-06-29 10:35:35 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-06-29 10:35:35 +0000
commitc17e3265852722d572614b96b8bda1105ee8352e (patch)
tree2eb71de26c30ddb543c19bebbe0713a5b05b50b6 /tests
parent493163963633e9746a1eaf84bc39c574e4432eb2 (diff)
Fixed #7378 -- Use the "to_field" where appropriate on reverse relations.
Patch from mturtle@gmail.com. The remaining uses of "%s__pk" in fields/related.py all look safe, since they are for many-to-many fields, which doesn't take "to_field" as a parameter. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7785 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/queries/models.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py
index 202b61647a..d7938f63a9 100644
--- a/tests/regressiontests/queries/models.py
+++ b/tests/regressiontests/queries/models.py
@@ -368,6 +368,10 @@ Bug #4510
>>> Author.objects.filter(report__name='r1')
[<Author: a1>]
+Bug #7378
+>>> a1.report_set.all()
+[<Report: r1>]
+
Bug #5324, #6704
>>> Item.objects.filter(tags__name='t4')
[<Item: four>]
@@ -777,8 +781,8 @@ this doesn't crash, it's a Good Thing.
>>> out = pickle.dumps(Item.objects.all())
Bug #7277
->>> a1 = Annotation.objects.create(name='a1', tag=t1)
->>> a1.notes.add(n1)
+>>> ann1 = Annotation.objects.create(name='a1', tag=t1)
+>>> ann1.notes.add(n1)
>>> n1.annotation_set.filter(Q(tag=t5) | Q(tag__children=t5) | Q(tag__children__children=t5))
[<Annotation: a1>]