﻿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
19195	Using distinct([*fields]) filter on a foreign key produces an ordering error when the foreign key has a Meta ordering field.	chrisedgemon@…	nobody	"I tried to using a distinct filter like this: Appearance.objects.order_by('team').distinct('team'); this fails with the following Database Error: ""DatabaseError: SELECT DISTINCT ON expressions must match initial ORDER BY expressions""

It is possible to work around this problem by using this modified filter: `Appearance.objects.order_by('team__id').distinct('team__id')`.

Model definition: http://pastebin.com/index/J45fy9fr
Full traceback: http://pastebin.com/feSFMbzX"	Bug	closed	Database layer (models, ORM)	1.7-beta-2	Release blocker	fixed	distinct, query	Simon Charette	Ready for checkin	1	0	0	0	0	0
