For example, with the following models:
{{{
from django.db import models
class Author(models.Model):
id = models.IntegerField()
name = models.CharField()
class Meta:
app_label = 'foo'
class Book(models.Model):
author_id = models.IntegerField()
author_name = models.CharField()
author = models.ForeignObject(Author, models.CASCADE, ['author_id',
'author_name'], ['id', 'name'])
class Meta:
app_label = 'foo'
}}}
Running the following filter:
`Book.objects.filter(author__isnull=True).query.__str__()`
Will result in:
{{{
AttributeError: 'MultiColSource' object has no attribute 'as_sql'
> .../django/db/models/sql/compiler.py(366)compile()
365 else:
--> 366 sql, params = node.as_sql(self, self.connection)
367 if select_format and not self.subquery:
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25972>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25972#comment:1>
Comment (by tomo-otsuka):
PR: https://github.com/django/django/pull/5858
--
Ticket URL: <https://code.djangoproject.com/ticket/25972#comment:2>
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/25972#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"8b6974a6857bdc48ad50bf21527b840c27648891" 8b6974a]:
{{{
#!CommitTicketReference repository=""
revision="8b6974a6857bdc48ad50bf21527b840c27648891"
Fixed #25972 -- Restored support for the isnull lookup with ForeignObject.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25972#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"bc5eed8fb0c4182a0f84eb78e729f05246312d84" bc5eed8f]:
{{{
#!CommitTicketReference repository=""
revision="bc5eed8fb0c4182a0f84eb78e729f05246312d84"
[1.9.x] Fixed #25972 -- Restored support for the isnull lookup with
ForeignObject.
Backport of 8b6974a6857bdc48ad50bf21527b840c27648891 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25972#comment:5>