django-filter icon indicating copy to clipboard operation
django-filter copied to clipboard

enhance django-filter.readthedocs.io for JSONField

Open tmc9031 opened this issue 4 years ago • 3 comments

according to newest django-rest-framework SearchFilter support JSONField whether django-filter could support JSONField ??? also add django-filter.readthedocs.io document context ???

https://www.django-rest-framework.org/community/3.12-announcement/ Nested searches against JSONField and HStoreField

https://www.django-rest-framework.org/api-guide/filtering/ For JSONField and HStoreField fields you can filter based on nested values within the data structure using the same double-underscore notation:

search_fields = ['data__breed', 'data__owner__other_pets__0__name']

tmc9031 avatar Nov 29 '20 12:11 tmc9031

it seems django-filter can support JSONField ( with some problems that i am not sure they related to django-filter or jsonfield )

you can read my issue and solution here:

https://github.com/carltongibson/django-filter/issues/1313

amirhoseinbidar avatar Jan 08 '21 09:01 amirhoseinbidar

See also #1110.

carltongibson avatar Aug 26 '21 14:08 carltongibson

Supposedly working example: https://github.com/carltongibson/django-filter/issues/1313#issuecomment-2293562219

carltongibson avatar Aug 16 '24 14:08 carltongibson