﻿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
21686	queryset.values() should let you name the resulting key	Wraithan	nobody	"Let me start by apologizing if this is already a ticket, I tried searching but 'queryset' and 'values' are both very common in tickets.

I propose that queryset.values() should work like queryset.annotate() where you can use kwargs to name the resulting key. My primary use case is when I am building custom JSON endpoints and I want to expose a related field to the front end, I'd like to rename the key to something shorter (but still contextually descriptive)


Example:

{{{#!python
MyModel.objects.values('slug', field='related__field')
# [{'slug': 'first-slug', 'field': 'related field data'}]
}}}
"	New feature	closed	Database layer (models, ORM)	1.6	Normal	duplicate	queryset, values, key, naming		Unreviewed	0	0	0	0	0	0
