Re: [web2py] Re: Simple query with variable table

2014-11-15 Thread Gael Princivalle
Yes with db[request.vars.table_name] directly in the grid it works, thanks a lot. -- Gael Princivalle 2014-11-15 17:35 GMT+01:00 Leonel Câmara : > Well it should work, in fact just passing db[request.vars.table_name] to > the grid should work, have you checked what's in requ

[web2py] Re: Simple query with variable table

2014-11-15 Thread Leonel Câmara
Well it should work, in fact just passing db[request.vars.table_name] to the grid should work, have you checked what's in request.vars.table_name? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com

Re: [web2py] Re: Simple query with variable table

2014-11-15 Thread Gael Princivalle
Ok but for a query to give to a grid ? This: query = db[request.vars.table_name].id > 0 don't work. -- Gael Princivalle 2014-11-15 16:59 GMT+01:00 Leonel Câmara : > Yeah, here's an example: > > if request.vars.table_name in db.tables: > db(db[request.vars.table_name].id

[web2py] Re: Simple query with variable table

2014-11-15 Thread Leonel Câmara
Yeah, here's an example: if request.vars.table_name in db.tables: db(db[request.vars.table_name].id > 0).select() -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo