﻿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
8025	Failed when lookups that span relationships with __isnull.	bear330	nobody	"I have two records like this:

{{{
id user  name            desc                                  parent  type
 5,   5, 'My favorites', 'The default group of user's group.',       ,    1
 6,   5, 'My traces',    'The default group of my traces.',         5,    2
}}}

When I query it with (user's id = 5):


{{{
TraceGroup.objects.filter(user=user, parent__parent__isnull=True)
}}}

I got:

[<TraceGroup: My favorites>, <TraceGroup: My traces>]

But the first record (My favorites) is not expected result for me.
I think this is because <My favorites>'s parent is null, parent__parent__isnull will be matched if parent is null.

I have to do this way to get correct result:


{{{
TraceGroup.objects.filter(user=user, parent__isnull=False, parent__parent__isnull=True)
}}}
 

Is this a bug or it should be commented at documentation?

Thanks."		closed	Core (Other)	dev		invalid	isnull, span		Accepted	0	0	0	0	0	0
