Google charts plugin added

189 views
Skip to first unread message

Tim Richardson

unread,
Oct 3, 2013, 7:03:09 PM10/3/13
to web...@googlegroups.com

Dave S

unread,
Oct 4, 2013, 1:49:34 PM10/4/13
to web...@googlegroups.com
On Thursday, October 3, 2013 4:03:09 PM UTC-7, Tim Richardson wrote:


Thanks!

/dps
 

Sarbjit

unread,
Nov 13, 2013, 5:42:39 AM11/13/13
to web...@googlegroups.com
Thanks Tim,

I have a question:

In your example, data is present in controller itself, how can I store the data effectively in database and then use that data for plotting graphs?

Can you please provide an example of how this can be stored/retrieved from db? I searched the net and found people suggesting pickle/json for storing/retrieving from db, but I'm not having any experience with both. Can you please help.

def plugin_return_data():
    data = [['Year','Sales','Expenses'],["2004",1000,400],["2005",1100,440],["2006",1200,600],
            ["2007",1500,800],["2008",1600,850],["2009",1800,900]]
    return dict(data=data)

-Sarbjit

Tim Richardson

unread,
Nov 13, 2013, 6:25:09 AM11/13/13
to
All you need to do is return data as an list. That's all the controller does.
So you need to learn how to retrieve data using the DAL, and put it into an list.
For example, you can get rows from a query, and iterate over the returned rows, building up the list. 
The DAL also offers syntax for retrieving data directly as a list.
Reply all
Reply to author
Forward
0 new messages