﻿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
32685	Add feature to preserve order in .filter(field__in=list) query	Barney Szabolcs	nobody	"filter {{{__in}}} query does not guarantee to preserve order, so I usually sort afterwards using python's sort. 

However, in **django admin** I cannot sort queries using python's sort when manipulating the QuerySet 
since I have to return a QuerySet.
So, I'd do something like
{{{ 
queryset.filter(my_field__in=values).raw(
    f'order by array_position(ARRAY[{ "","".join([""%s""]*len(values)) }]::varchar[], my_field)', 
    params=values)
 }}}
but this does not work...
is there a solution here?  (I cannot use raw either since I have a queryset input argument to work with)

"	Uncategorized	new	Uncategorized	2.2	Normal				Unreviewed	0	0	0	0	0	0
