I have written a custom ActiveQuerySet method for it.
You can find the solution in the following link which works for simple JSON 
structure.
https://stackoverflow.com/questions/44368818/fetch-json-field-value-using-values-in-django

On Thursday, June 8, 2017 at 4:45:08 PM UTC+5:30, Mallik Sai wrote:
>
> I have a JSON Field in my model and I want to get a particular Key value 
> which is present in the JSON Field using values().
>
> lets assume my JOSN Field data is like { 'key1':value1 , 'key2':value2 
> ,'key3':value3 }
>
> I want to give the query like MyModel.objects.values('field1' , 'field2' , 
> 'key2(which is present in Json Field)')
>
> Please help me whether I can get in using values() or How can I override 
> the values() functionality
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64172ca1-00b8-4e65-b82a-4e33cadfa70e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to