[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-11 Thread Anthony
See my answer on SO: http://stackoverflow.com/a/18740517/440323 Anthony On Tuesday, September 10, 2013 8:29:05 AM UTC-4, Gliese 581 g wrote: > > Hi Anthony, > Thanks for this useful information. > I tried > searchform.process(keepvalues=True).accepted > But it evaluates to False. > While below

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-10 Thread Gliese 581 g
Hi Anthony, Thanks for this useful information. I tried searchform.process(keepvalues=True).accepted But it evaluates to False. While below given line evaluates to True. if searchform.accepts(request.vars,keepvalues=True): I dont know why does it happens. Have I done anything wrong over here?

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-10 Thread Anthony
You are processing the form twice: if searchform.accepts(request.vars,keepvalues=True): searchform.process() searchform.process() ultimately calls .accepts() -- no need to call both. The preferred method is now: if searchform.process(keepvalues=True).accepted: Also, once you load the first

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-09 Thread Gliese 581 g
Hi Massimo, Thanks for suggesting this solution. I am now able to display a gird on my page with pagination and sorting options available. But whenever I click on page number or try to sort a column by clicking on its header, nothing happens. I get a blank page. I tried to debug it and found tha

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-08 Thread Anthony
Not great if you need pagination, though (you'd need to fetch all the data from the API and put it in the temporary in-memory DB). Perhaps another option would be to create a custom DAL adapter and override the .select() and .count() methods to pull data and counts from the API. Could get compl

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-08 Thread Massimo Di Pierro
You cannot unless you first load the data in a database. You can use a temporary in memory database like this: fields = [Field('one'), Field('two'), Field('three'), ...] temp_db = cache.ram('tmp_db',lambda: DAL('sqlite:memory').define_table('mytable',*fields)._db, None) temp_db.mytable.truncate

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-08 Thread Gliese 581 g
Hi Massimo, I will try to be more specific. I am developing a web2py application(APP1) which works on the data which it gets from another web2py application(APP2). We do not have access to the database of APP2, we access their data through jsonrpc web services exposed by APP2. Now, there is an AP

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-06 Thread Massimo Di Pierro
We need more details but SQLFORM.grid is for displaying and editing tabular data from the database. On Friday, 6 September 2013 09:56:54 UTC-5, Gliese 581 g wrote: > > ** > > I am working on a project where we have a different subsystem whose API > returns a list of certain type of objects. >