﻿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
34868	Add K as an alias for KeyTransform.from_lookup	Paolo Melchiorre	nobody	"I propose to add K as an alias for KeyTransform.from_lookup

It's something possible to do in `django.contrib.postgres` before Django 3.1 and it can still be useful now to get non-textual data back from database.

This would be an example of use and I show the difference with KT

{{{#!pycon
>>> qs = MyModel.objects.all()
>>> values = qs.values_list(
    K(""value__true""),
    K(""value__false""),
    K(""value__none""),
    K(""value__dict""),
    K(""value__list""),
)
[True, False, None, {""k"": ""v""}, [None, True, False]]
>>> text_values = qs.values_list(
    KT(""value__true""),
    KT(""value__false""),
    KT(""value__none""),
    KT(""value__dict""),
    KT(""value__list""),
)
[""true"", ""false"", ""null"", '{""k"":""v""}', ""[null,true,false]""]
}}}
"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	wontfix	json key type		Unreviewed	1	1	0	0	0	0
