Thanks, i guess I am not a tabble bit js fluent. So I have to turn the dict to json, post it and use the @request.restful() service and POST in the eco_report()?
Is there also a way to keep the "graph_data" as a global dict/list and use it like that:? def eco_report(): create_report(graph_data): .......... On Monday, June 9, 2014 1:02:00 AM UTC+3, Avi A wrote: > > Hi, > I want to pass a dict in ajax function like that: > $("#create_report").click(function(){ > url_report = 'eco_reports?graph_data={{=graph_data}}'; > ajax(url_report, '', 'save_as_link'); > > and the controller starts with something like that: > def eco_reports():: > for item in (request.vars.graph_data): > something item.f_test_name > ...... > > The error I get: > > AttributeError: 'str' object has no attribute 'f_test_name' > > what's the way to do what I Want? > > thanks > > > > > > > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.