diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index dde1494..d0be613 100644
a
|
b
|
class Query(object):
|
1006 | 1006 | can_reuse) |
1007 | 1007 | return |
1008 | 1008 | |
1009 | | if (lookup_type == 'isnull' and value is True and not negate and |
1010 | | len(join_list) > 1): |
| 1009 | if (lookup_type == 'isnull' and not negate and len(join_list) > 1): |
1011 | 1010 | # If the comparison is against NULL, we may need to use some left |
1012 | 1011 | # outer joins when creating the join chain. This is only done when |
1013 | 1012 | # needed, as it's less efficient at the database level. |
diff --git a/tests/regressiontests/model_inheritance_regress/models.py b/tests/regressiontests/model_inheritance_regress/models.py
index c669b23..c3a8c07 100644
a
|
b
|
import datetime
|
6 | 6 | |
7 | 7 | from django.db import models |
8 | 8 | |
9 | | # Python 2.3 doesn't have sorted() |
10 | | try: |
11 | | sorted |
12 | | except NameError: |
13 | | from django.utils.itercompat import sorted |
14 | 9 | |
15 | 10 | class Place(models.Model): |
16 | 11 | name = models.CharField(max_length=50) |
… |
… |
AttributeError: 'Person' object has no attribute 'messybachelorparty_set'
|
385 | 380 | >>> p4.bachelorparty_set.all() |
386 | 381 | [<BachelorParty: Bachelor party for Bob>, <BachelorParty: Bachelor party for Dave>] |
387 | 382 | |
388 | | """} |
| 383 | # This works |
| 384 | >>> Place.objects.exclude(restaurant=None) |
| 385 | [<Place: the place>] |
389 | 386 | |
| 387 | # ... and this doesn't. |
| 388 | >>> Place.objects.filter(restaurant__isnull=False) |
| 389 | [<Place: the place>] |
| 390 | """} |