Re: How to override the functionality of values()

2017-06-08 Thread Mallik Sai
By writing a custom method in ActiveQuerySet manager https://stackoverflow.com/questions/44368818/fetch-json-field-value-using-values-in-django On Thursday, June 8, 2017 at 4:44:35 PM UTC+5:30, Mallik Sai wrote: > > I my models I have a JSON Field and I want to get a particular key value

Re: How to get JOSN Field key value using values()

2017-06-08 Thread Mallik Sai
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

How to get JOSN Field key value using values()

2017-06-08 Thread Mallik Sai
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(w

How to override the functionality of values()

2017-06-08 Thread Mallik Sai
I my models I have a JSON Field and I want to get a particular key value from json field in using values(). assume my JOSN Field data is like {'key1':value1,'key2':value2,'key3':value3} eg: MyModel.objects.values( "field1", "field2", "key1(which is present in json field)" ) Is there any way