diff -ur orig.trunk/django/db/models/sql/query.py trunk/django/db/models/sql/query.py
old
|
new
|
|
1443 | 1443 | query.bump_prefix() |
1444 | 1444 | query.clear_ordering(True) |
1445 | 1445 | query.set_start(prefix) |
1446 | | self.add_filter(('%s__in' % prefix, query), negate=True, trim=True, |
| 1446 | new_prefix = prefix.split(LOOKUP_SEP)[0] |
| 1447 | self.add_filter(('%s__in' % new_prefix, query), negate=True, trim=True, |
1447 | 1448 | can_reuse=can_reuse) |
1448 | 1449 | |
1449 | 1450 | # If there's more than one join in the inner query (before any initial |
diff -ur orig.trunk/tests/regressiontests/queries/tests.py trunk/tests/regressiontests/queries/tests.py
old
|
new
|
|
42 | 42 | n2 = Note.objects.create(note='n2', misc='bar', id=2) |
43 | 43 | self.n3 = Note.objects.create(note='n3', misc='foo', id=3) |
44 | 44 | |
45 | | ann1 = Annotation.objects.create(name='a1', tag=self.t1) |
| 45 | ann1 = Annotation.objects.create(name='a1', tag=self.t1, id=11) |
46 | 46 | ann1.notes.add(self.n1) |
47 | | ann2 = Annotation.objects.create(name='a2', tag=t4) |
| 47 | ann2 = Annotation.objects.create(name='a2', tag=t4, id=12) |
48 | 48 | ann2.notes.add(n2, self.n3) |
49 | 49 | |
50 | 50 | # Create these out of order so that sorting by 'id' will be different to sorting |
51 | 51 | # by 'info'. Helps detect some problems later. |
52 | | self.e2 = ExtraInfo.objects.create(info='e2', note=n2) |
53 | | e1 = ExtraInfo.objects.create(info='e1', note=self.n1) |
| 52 | self.e2 = ExtraInfo.objects.create(info='e2', note=n2, id=22) |
| 53 | e1 = ExtraInfo.objects.create(info='e1', note=self.n1, id=21) |
54 | 54 | |
55 | 55 | self.a1 = Author.objects.create(name='a1', num=1001, extra=e1) |
56 | 56 | self.a2 = Author.objects.create(name='a2', num=2002, extra=e1) |
… |
… |
|
80 | 80 | Cover.objects.create(title="first", item=i4) |
81 | 81 | Cover.objects.create(title="second", item=self.i2) |
82 | 82 | |
| 83 | def test_ticket12823(self): |
| 84 | self.assertQuerysetEqual( |
| 85 | Author.objects.exclude(extra__note__annotation__name ='a2'), |
| 86 | ['<Author: a1>', '<Author: a2>'] |
| 87 | ) |
| 88 | |
83 | 89 | def test_ticket1050(self): |
84 | 90 | self.assertQuerysetEqual( |
85 | 91 | Item.objects.filter(tags__isnull=True), |