I currently develop a Django project and try to implement WebDataRocks WebDataRocks is a free web reporting tool for data analysis and visualization
I works but my problem deal with correctly presenting data to be updated in Webdatarocks I would like to update each of my models.
I have a views name data use with my template that load WebDataRocks
def data(request):
data = serializers.serialize("json", mymodel.objects.filter(med_ide__lte=10))
return render(request, 'myapp/data.html', {'data':data})
I do not really understand the way json is produce because I get this format:
[
{
"model": "myapp.mymodel",
"pk": 1,
"fields":
{
"var1": 1,
"var2": "ABC",
"var3": "code",
"var4": "text",
"var5": null,
"var6": "'text'",
"var7": null
}
},
{
"model": "myapp.mymodel",
....
}
]
The only 2 variables I get access in webdatarocks table are myapp.mymodel and pk I try to extract only part of my data I need (=fields) using things like data['fields'] but it is not the right syntax
what is wrong?