﻿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
32117	Aggregation doesnt work with Models, ordered by Meta subclass	eloktev	nobody	"Hello, 
Using aggregation methods with models, that have set 'ordering' in Meta subclass fails:
{{{
class M1 (models.Model)
    date = models.DateField()
    smth = models.IntegerField()    

    class Meta:
        ordeing = 'smth'

count_by_day_qs = M1.objects.values('date').annotate(c=models.Count('id')).values('date', 'c')
}}}}
Returns executes following query:
{{{{
SELECT ""m1"".""date"", COUNT(""m1"".""id"") AS ""c"" FROM ""m1"" GROUP BY ""m1"".""date"", ""m1"".""smth""
}}}}
"	Uncategorized	new	Uncategorized	3.1	Normal		aggregation, database, psycopg2		Unreviewed	0	0	0	0	0	0
