The web2py grid provides functionality specific to working with database tables defined via the DAL, such as pagination, sorting, searching, field representation, virtual fields, and CRUD operations on records. When dealing with data from third party API's or from other formats (e.g., CSV files), some of those features are irrelevant (e.g., the CRUD functionality), and others would be difficult to implement in a general way due to the diversity of APIs and data formats (and would still require you to write your own data processing code and/or do a lot of configuration in order to interface with the grid's API). Because there are already good general purpose data grids that meet this need (such as Datatables <http://datatables.net/>), there would be little benefit to a web2py-specific grid that is divorced from web2py-specific models.
Anthony On Tuesday, September 22, 2015 at 3:31:55 AM UTC-4, Gary Cowell wrote: > > 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.