def jsonlist():
import gluon.contrib.simplejson
L = [ { 'label': "Foo", 'data': [ [10, 1], [17, -14], [30, 5] ] },
{ 'label': "Bar", 'data': [ [11, 13], [19, 11], [30, -7] ] } ]
response.headers['Content-Type']='text/json'
return gluon.contrib.simplejson.dumps(L)
On Dec 29, 9:38 am, bova <[email protected]> wrote:
> Hello!
>
> I'm using web2py with jquery and jquery.flot plugin
>
> Tell me please how can I get json output like following:
> [ { label: "Foo", data: [ [10, 1], [17, -14], [30, 5] ] },
> { label: "Bar", data: [ [11, 13], [19, 11], [30, -7] ] } ]