﻿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
10412	queryset.values(*fields) should return field instances, not raw values	to.roma.from.djbug@…	nobody	"Currently, [http://docs.djangoproject.com/en/dev/ref/models/querysets/#values-fields the values(*fields) method] of queryset objects returns the raw database data, not what fields’ to_python would have returned. For many kinds of fields it is useless. For example, a result of the values() invocation can look like

[{""id"": 42, ""is_interesting"": 1, ""photo"": ""some/path/image.jpg""}]

while it could have been something like

[{""id"": 42, ""is_interesting"": True, ""photo"": ImageFieldFile(""some/path/image.jpg"")}]

The database only holds the data, not its interpretation. Observe how the data for the image field is useless without knowing upload_to, and (for MySQL) Django can’t convert 1 to True because it doesn’t know that the field is in fact a BooleanField (cf. “wontfix” #7190). And isn’t it counter-intuitive for qs.all().values()[ 0 ][ ""something"" ] to differ from qs.all()[ 0 ].something?

Fixing this will also allow to fix #7190 once and for all, a bug into which I ran as recently as today.

Regarding documentation, it doesn’t document what qs.values().values() are at all, so nothing to break."		closed	Uncategorized	1.0		duplicate			Unreviewed	0	0	0	0	0	0
