﻿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
24084	Alias related properties inside values()	Bibhas C Debnath	nobody	"Right now we can use values() to fetch properties like this - 

{{{
>>> Entry.objects.values('blog')
[{'blog': 1}, ...]
}}}

But I have a case where I need to fetch a property from a related mode so I'm doing this -

{{{
>>> Boundary.objects.values('id', 'school__liblangagg__class_name')
[{'school__liblangagg__class_name': 6, 'id': 8999}, {'school__liblangagg__class_name': 5, 'id': 8954}, {'school__liblangagg__class_name': 3, 'id': 9000}, {'school__liblangagg__class_name': 2, 'id': 8942},]
}}}

It'd be really convenient if I could alias the related property. Something like this -

{{{
>>> Boundary.objects.values('id', ('class_name', 'school__liblangagg__class_name'))
[{'class_name': 6, 'id': 8999}, ... ]
}}}

So in place of the string representing the related property, we could have a tuple (alias, related_string). The output looks a bit ugly to pass this on to somewhere and it's a bit of work to iterate over all of them and replace the key.

Does it seem like a feature worth considering?"	New feature	closed	Database layer (models, ORM)	dev	Normal	duplicate			Unreviewed	0	0	0	0	0	0
