﻿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
27849	Add SQL 2003 FILTER syntax support with Case(When()) fallback to aggregates	Tom Forbes	Tom Forbes	"In some circumstances being able to filter results included in an ArrayAgg is needed. PostgreSQL supports this through the FILTER WHERE clause:

{{{
SELECT ARRAY_AGG(id) FILTER (WHERE id < 10) as foo FROM table
}}}

Adding support for Q expressions in the ArrayAgg class could provide this functionality, i.e:


{{{
SomeModel.objects.annotate(foo=ArrayAgg('some_relation__id', where=Q(some_relation__bar=10)))
}}}
"	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
