﻿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
33935	Support unaccent function in JSONField values	Foucauld Degeorges	nobody	"With a JSONField value with the following shape: {{{ my_object.my_json_field = {""en"": ""sôme téxt""} }}}

Doing the following queryset: {{{MyModel.objects.filter(my_json_field__en__unaccent__icontains=""text"")}}} does not match the above record, because Django interprets ""unaccent""' as a key to find in the JSON dict, whereas I meant the PostgreSQL {{{unaccent}}} function.

By comparison, with a CharField, {{{MyModel.objects.filter(my_char_field__unaccent__icontains=""test"")}}} works as expected.

It seems that {{{ unaccent}}} is only supported on CharField and TextField for now, but since what I am trying to do is possible in SQL, it might be made possible as well using the ORM.

Details in this StackOverflow question: https://stackoverflow.com/questions/73385812/looking-up-value-in-jsonfield-with-unaccent-and-icontains
.

I am tagging QuerySet.extra because my workaround was to write the SQL where clause I expected using {{{QuerySet.extra}}}."	Uncategorized	closed	Database layer (models, ORM)	3.2	Normal	duplicate	QuerySet.extra		Unreviewed	0	0	0	0	0	0
