Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a test to show that #7227 was also fixed by [7778].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7779 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 6d79ecc8b1f6c54c755c4c9cd1e9da11d533db96 1 parent bb21824
@malcolmt malcolmt authored
Showing with 22 additions and 7 deletions.
  1. +22 −7 tests/regressiontests/queries/models.py
View
29 tests/regressiontests/queries/models.py
@@ -10,7 +10,8 @@
class Tag(models.Model):
name = models.CharField(max_length=10)
- parent = models.ForeignKey('self', blank=True, null=True)
+ parent = models.ForeignKey('self', blank=True, null=True,
+ related_name='children')
def __unicode__(self):
return self.name
@@ -25,6 +26,14 @@ class Meta:
def __unicode__(self):
return self.note
+class Annotation(models.Model):
+ name = models.CharField(max_length=10)
+ tag = models.ForeignKey(Tag)
+ notes = models.ManyToManyField(Note)
+
+ def __unicode__(self):
+ return self.name
+
class ExtraInfo(models.Model):
info = models.CharField(max_length=100)
note = models.ForeignKey(Note)
@@ -236,12 +245,12 @@ class Child(models.Model):
>>> c2 = Cover(title="second", item=i2)
>>> c2.save()
->>> n1 = Number(num=4)
->>> n1.save()
->>> n2 = Number(num=8)
->>> n2.save()
->>> n3 = Number(num=12)
->>> n3.save()
+>>> num1 = Number(num=4)
+>>> num1.save()
+>>> num2 = Number(num=8)
+>>> num2.save()
+>>> num3 = Number(num=12)
+>>> num3.save()
Bug #1050
>>> Item.objects.filter(tags__isnull=True)
@@ -796,5 +805,11 @@ class Child(models.Model):
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)
+>>> n1.annotation_set.filter(Q(tag=t5) | Q(tag__children=t5) | Q(tag__children__children=t5))
+[<Annotation: a1>]
+
"""}
Please sign in to comment.
Something went wrong with that request. Please try again.