I have this stored in my serializedDictionaryField:
data = {
'k1': 'v1',
'k2': 'v2',
'k3': {'nested_k': 'nested_v'}
}
Is it possible to filter by values of nested dictionary? something like
Model.objects.filter(data__contains={'nested_k': 'nested_v'})
HStoreFieldis just mapping string to string and does not support nested structure, you can use ratherJSONFieldwhich come as built-in Posgres Field in Django 1.9+ and posgres 9.4+.models.py:
views.py: