﻿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
19173	"""query"" param for Model.objects.none() queryset has unexpected value."	joshua.fialkoff@…	nobody	"1. Create Django model:


{{{
class Location(models.Model):
  name = models.CharField(max_length=100)
}}}


2. Get a null set


{{{
res = Location.objects.none()
}}}


3. Check the SQL relating to this set:


{{{
print(res.query.sql_with_params())
>> ('SELECT ""name"" FROM ""location"", ())
}}}


The SQL above would actually return all the records in the database. My expectation is that I'd get the same result here as when I do the following:


{{{
query = Location.objects.filter(id__in=[])
print(query.sql_with_params())
}}}


This, in fact, throws an EmptyResultSet error which seems reasonable as there's really no SQL statement to go along with a purposefully empty set."	Uncategorized	closed	Uncategorized	1.4	Normal	fixed			Unreviewed	0	0	0	0	0	0
