﻿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
10113	aggregation annotations on related tables do not work with ordering on field in different related table	Koen Biermans <koen.biermans@…>	Russell Keith-Magee	"Using annotate on a related table in combination with ordering on a field from a different related table results in failures.

There seem to be two problems:

- the related orderby field is not included in the GROUP BY, which does not work on Postgres

- the related table (of the orderby field) is included with an inner join, which comes after the left outer join of the annotation tables, which leads to incorrect results.

This is easier to explain with an example, so I am including a diff that contains a small testcase demonstrating the problem."		closed	Database layer (models, ORM)	dev		fixed	aggregation		Accepted	0	0	0	0	0	0
