diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 394e30b..2fb077b 100644
a
|
b
|
class BaseQuery(object):
|
1627 | 1627 | entry.add((Constraint(alias, col, None), 'isnull', True), AND) |
1628 | 1628 | entry.negate() |
1629 | 1629 | self.where.add(entry, AND) |
| 1630 | elif connector != OR and value: |
| 1631 | if len(join_list) > 1: |
| 1632 | for alias in join_list: |
| 1633 | if self.alias_map[alias][JOIN_TYPE] == self.LOUTER: |
| 1634 | data = list(self.alias_map[alias]) |
| 1635 | data[JOIN_TYPE] = self.INNER |
| 1636 | self.alias_map[alias] = tuple(data) |
| 1637 | break |
1630 | 1638 | |
1631 | 1639 | if can_reuse is not None: |
1632 | 1640 | can_reuse.update(join_list) |
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py
index b5fa377..dc90879 100644
a
|
b
|
class Plaything(models.Model):
|
271 | 271 | def __unicode__(self): |
272 | 272 | return self.name |
273 | 273 | |
| 274 | class Venue(models.Model): |
| 275 | name = models.CharField(max_length=100) |
| 276 | |
| 277 | class Event(models.Model): |
| 278 | name = models.CharField(max_length=100) |
| 279 | venue = models.ForeignKey(Venue, null=True) |
| 280 | |
| 281 | def __unicode__(self): |
| 282 | return self.name |
| 283 | |
274 | 284 | |
275 | 285 | __test__ = {'API_TESTS':""" |
276 | 286 | >>> generic = NamedCategory.objects.create(name="Generic") |
… |
… |
True
|
1143 | 1153 | >>> r.save() |
1144 | 1154 | >>> Ranking.objects.all() |
1145 | 1155 | [<Ranking: 3: a1>, <Ranking: 2: a2>, <Ranking: 1: a3>] |
| 1156 | |
| 1157 | >>> v = Venue.objects.create(name="Googleplex") |
| 1158 | >>> _ = Event.objects.create(name="Release Party") |
| 1159 | >>> _ = Event.objects.create(name="DjangCon 2008", venue=v) |
| 1160 | >>> 'LEFT OUTER JOIN' in Event.objects.exclude(venue__name='a').exclude(venue=None).query.as_sql()[0] |
| 1161 | False |
1146 | 1162 | """} |
1147 | 1163 | |
1148 | 1164 | # In Python 2.3 and the Python 2.6 beta releases, exceptions raised in __len__ |