Solved it using Pickle.

-Sarbjit

On Saturday, November 16, 2013 2:24:24 PM UTC+5:30, Sarbjit wrote:
>
> I am using the slice from 
> http://www.web2pyslices.com/slice/show/1721/google-charts-plugin.
>
> To store the data to be used for plotting in google charts, I am using the 
> following :
>
> To Create :- (Example)
>
> data = [['Year','Sales','Expenses'],["2004",1000,400],["2005",1100,440]]
>
> How I am doing :-
>
> list1 = [] # For Row2 (how to store and retrieve from db)
> list1.append("2004")
> list1.append(1000)
> list1.append(400)
>
> import json 
> list1b = json.dumps(list1)
> db.sampletable.insert(list1a=list1b)
> db.commit()
>
> >>>>>>
>  x = db(db.sampletable.id==1).select()[0].list1a
> json.load(x)
> AttributeError: 'str' object has no attribute 'read'
>
> Similarly, If I don't use the json.dumps method first, I get the same 
> error.
>
> I want to know how can I store the sublists in db and then can retrieve 
> them to make them as data list (pointed in the beginning).
>
> -Sarbjit
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to