﻿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
34079	Excessive parentheses when generating a query	Lelikov	Aman Pandey	"ORM: 
{{{
Model.objects.filter(field=Func(F(""user__notification_email_types""), function=""ANY"")
}}}

SQL:
{{{
...""app_model"".""filed"" = (ANY(""app_user"".""notification_email_types"")))
}}}

Error:
{{{
syntax error at or near ""ANY""
}}}

The reason for the code change in version 4.0. The excessive parentheses around the function ANY
django/db/models/lookups.py
{{{
if sql and sql[0] != ""("":
    sql = ""(%s)"" % sql
}}}
In version 3.2 everything worked correctly
"	Bug	closed	Database layer (models, ORM)	4.1	Normal	invalid		Peter Lithammer Simon Charette	Unreviewed	0	0	0	0	0	0
