﻿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
29769	JSONField lookup and F Objects	Gabor Körber		"Currently, it is rather undocumented, that F Functions do not perform JSON Lookups.

I suggest to either introduce a similar Object that is capable, or similar solution to make this possible; at the very least however, I suggest to add this information to the documentation for JSONField in django docs.

I stumbled on this when I tried to rewrite a raw statement in the form of
`SELECT fields FROM schema WHERE lower(unaccent(jsonfield->lookup->>data)) LIKE lower(searchterm) ...` 

and also stumbled on stackoverflow  dealing with this issue: https://stackoverflow.com/questions/40623820/django-jsonfield-postgres-and-f-object-comparison

Note, that if lookups in F might not easily be adaptable, the stackoverflow question has a nice side effect of showing off a possible complementary solution: overwrite/extend `__getitem__` for `F` objects to deal with json / subfield lookups.

--
I thought brainstorming about such would be benefitial,
If I have overseen an already existing workaround I am eager to get corrected."	New feature	new	contrib.postgres		Normal		F JSONField lookup		Unreviewed	0	0	0	0	0	0
