﻿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
19407	queryset.none() acts like queryset.all() when using a values_list in a filter	orblivion	nobody	"I'm using PostgreSQL 9.1.6 

This does not work as expceted:

{{{#!python
In : User.objects.filter(id__in = Profile.objects.none().values_list('user_id', flat = True))
Out: [<User: xxx>, <User: yyy>...]
}}}

However without values_list, the similar works as expected:

{{{#!python
In : User.objects.filter(profile__in = Profile.objects.none())
Out: []
}}}

Casting values_list to list works as expected:

{{{#!python
In : User.objects.filter(id__in = list(Profile.objects.none().values_list('user_id', flat = True)))
Out: []
}}}

In fact values_list claims to be EmptyQuerySet of [], as expected:

{{{#!python
In : Profile.objects.none().values_list('user_id', flat = True)
Out: []
}}}

And a manually empty QuerySet works:

{{{#!python
In : User.objects.filter(id__in = Profile.objects.filter(blah__in = []).values_list('user_id', flat = True))
Out: []
}}}"	Uncategorized	closed	Database layer (models, ORM)	1.4	Normal	worksforme		orblivion sssbox@…	Unreviewed	0	0	1	0	0	0
