data =  [{"exped": "MA", "destin": "AL", "count": 2}, {"exped": "MA", 
"destin": "BS", "count": 1}] 
mylist = []
for a in data :
    mylist.append([a['exped'],a['destin'],a['count']])



On Sunday, 24 May 2020 17:16:46 UTC+5:30, HJ wrote:
>
> hello guys hope you are doing well 
>
> I am trying to make a highchart but I found a problem in the view function 
> so my chart doesn't show becuase of that 
>
> view function 
>
> def jsonDepend(request):
>  dataset = mail_item_countries_depend.objects.all().values('exped',
> 'destin','count')
>  data = list(dataset)
>
>   return JsonResponse(data, safe=False)
>
>
> my views function show something like this : [{"exped": "MA", "destin": 
> "AL", "count": 2}, {"exped": "MA", "destin": "BS", "count": 1}]  
>
> how can I store it like that : [["MA", "AL",  2], ["MA", "BS", 1]] 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0a644423-e96c-46d5-9f3e-c9dd3195f189%40googlegroups.com.
  • JSON data HJ
    • Re: JSON data Saurabh Adhikary

Reply via email to