﻿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
14110	iexact lookup doesn't work with subquery values	Alexander Schepanovski	Alexander Schepanovski	"With PostgreSQL and model
{{{
class Category(models.Model):
    title = models.CharField(max_length=127)

}}}
we have:
{{{
>>> Category.objects.filter(title__icontains=Category.objects.filter(pk=1).values('title'))
DatabaseError: syntax error at or near ""(""
LINE 1: ...PPER(""board_category"".""title""::text) LIKE UPPER() (SELECT U0...

>>> print connection.queries[-1]['sql']
SELECT ""app_category"".""id"", ""app_category"".""title"" FROM ""app_category"" WHERE UPPER(""app_category"".""title""::text)
LIKE UPPER() (SELECT U0.""title"" FROM ""app_category"" U0 WHERE U0.""id"" = 1 )
}}}

problem with every lookup for which %s is in the middle of connection.operators[lookup] 
"		closed	Database layer (models, ORM)	1.2		wontfix	sprintdec2010		Unreviewed	1	0	0	0	0	0
