﻿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
20408	values_list(flat=True) returns ValuesListQuerySet, not list	Mark Tranchant	alextreme	"The documentation should be updated to clarify that the structure returned by a values_list queryset with flat=True is not a plain list, but a ValuesListQuerySet. Alternatively, the code should actually output a list.

I spent a while struggling to understand why I couldn't use the Python x.count(y) function on the output of such a query before realizing that I wasn't working with a Python list:

{{{
> rlist = Rpt.objects.values_list('status', flat=True)
> type(rlist)
  django.db.models.query.ValuesListQuerySet
> rlist.count(1)
  TypeError: count() takes exactly 1 argument (2 given)
> rlist2 = list(Rpt.objects.values_list('status', flat=True))
> rlist2.count(1)
  6
}}}
"	Cleanup/optimization	closed	Documentation	1.4	Normal	fixed	values_list queryset list		Ready for checkin	1	0	0	0	1	0
