﻿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
25977	Allow different filters on multiple aggregates	Kyle Agronick	nobody	"This is the query I that appears to be impossible to implement using the ORM:
{{{
SELECT id, name, start_date, 
(SELECT count(state) FROM jobs_job WHERE  state = 'F' and job_group_id  = jg.id GROUP BY state) as badcount , 
(SELECT count(state) FROM jobs_job WHERE state = 'C'  and job_group_id  = jg.id GROUP BY state) as goodcount 
FROM jobs_jobgroup as jg
}}}
The main table represents a job group. The two queries tell how many successes and failures there are in the jobs for the job group. Currently, there is no way to have multiple aggregates with different filters on each one. You can't do `annotate(fail_count=Count('job__state').filter(state='F'), good_count=Count('job__state').filter(state='C'))` or something similar."	New feature	closed	Database layer (models, ORM)	1.9	Normal	invalid	QuerySet.extra	Simon Charette	Unreviewed	0	0	0	0	0	0
