The need to represent data from web services inside a web2py app must be a 
fairly common requirement, I think. I certainly need(ed) to for a project.

I used a sqlite mem db for each page (I was calling Amazon AWS through 
boto, get lists of stuff, etc.). I did three things to represent my data.

Firstly, I called some aws APIs and store the result in dicts and lists in 
session.

Secondly, I used sqlite mem db DAL object , iterated inserts to these from 
the dicts/lists , and built sqlform.grid from these.

Thirdly, I used sqlform factory with IS_IN_SET for my lists and dicts in 
session, so I could provide drop down lists of AWS responses in forms.

This was a small, but useful app, which was used by no more than about 6 
people, so it worked well. Don't know how well this will scale with the 
sqlite mem db (probably not well).

I'd love a component that would populate grids and lists from arbitrary 
data, such as from boto or indeed any other web service call.

On Thursday, 10 September 2015 22:42:30 UTC+1, Luis Valladares wrote:
>
> Hello! I'm trying to use SQLFORM.grid (or something like this) to my 
> website, but this page doesnt have a database because it consumes all the 
> data form a service, so i ask the service for the list of records in a 
> table and i recieve it in json format and transform to dictionary.
>
> What i want to do is use this dictionary to create a grid (Like the 
> SQLFORM.grid) but the grid doesnt work if i dont specify a query, there is 
> a way to create a grid without query and instead with a dictionary?
>
> Thanks for any help you can give!
>

-- 
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.

Reply via email to