﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16135	Model 'Child' is inherited from 'Parent', expecting to get only Child results with Parent.objects.filter(child__isnull=False), but does not work.	Robin		"Example model: 
{{{
   class Parent(models.Model): 
        name = models.CharField(max_length='20',blank=True) 
    class Child(Parent): 
        pass 
}}}
I want to get the result of Child.objects.all() but I '''do not''' want to 
use Child. 
I want to use Parent instead, which I tried to do with:
{{{
    Parent.objects.filter(child__isnull=False) # not work, but should
}}}
Which '''doesn't work''' and gives the result of Product.objects.all() instead. 

However If I do the following, '''it works''':
{{{
    Parent.objects.exclude(child__isnull=True) # work
}}}

If I insist on using:
{{{
    Parent.objects.filter(child__isnull=False) # will work if do below
}}}
Then it '''will work if''' I use the OneToOneField for Child.
{{{
    class Child(models.Model): 
        parent = models.OneToOneField(Parent) 
}}}

I expect the query to also work with Model Inheritance as well.

Also discussed in http://groups.google.com/group/django-users/browse_thread/thread/9e20b70811f386a8"	Bug	closed	Database layer (models, ORM)	1.3	Normal	fixed		nikolay@…	Accepted	0	0	0	0	0	0
