﻿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
28240	django.db.models.query.values not acting as documented	Meckl Antal	nobody	"Hello, I'm using .values() to select distinct values and annotate them with a Count.
Here is the example code: 

{{{
MyObjects.objects.values('image')
QuerySet [
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'dbd582eb-c8b6-45d8-8787-24fc8467cbce'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}, 
{'image': u'dbd582eb-c8b6-45d8-8787-24fc8467cbce'}, 
{'image': u'40476fd4-ad65-4846-b307-51ddf901da53'}]
}}}


The documentation says:

[https://docs.djangoproject.com/en/1.11/topics/db/aggregation/#values ""...you will only get an annotated result for each unique author name...""]

"	Bug	closed	Database layer (models, ORM)	1.11	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
