Re: [web2py] parenthesis in SQLFORM.grid search

2015-05-07 Thread Richard Vézina
Here what I got for now : from pyparsing import nestedExpr # Not the worse case but has enough complexity to start with grouped_query_string = \ 'a_table.integer_field 1) ' \ ' (a_table.integer_field not equal 2) ' \ ' (~a_table.integer_field in 200, 300, 400))

Re: [web2py] parenthesis in SQLFORM.grid search

2015-05-07 Thread Richard Vézina
Recursive problem... I get closer, but have a lot of difficulty figuring out how to assembling the nested queries in the right order and the right depth of each query... I have been so far able to extract a flatten dict of each individually nested query and translated them into web2py query...

Re: [web2py] parenthesis in SQLFORM.grid search

2015-04-30 Thread Johann Spies
Will it not be easier to encapsulate your complex query in a database view and run the grid on the view? e.g. in the controller: db.execute(create view xx as complexquery) db.define_table('xx', Field1(), Field2... Johann -- Because

Re: [web2py] parenthesis in SQLFORM.grid search

2015-04-30 Thread Richard Vézina
It could work of course, but it hurts to have to do that to just filter out correctly a dropdown menu... What I was doing until now was to have a single returning json_feed which for each dropdown required... But it not try, I need to create almost identical function for each particular dropdown

[web2py] parenthesis in SQLFORM.grid search

2015-04-29 Thread Richard
Hello, It seems that SQLFORM.grid search tool not accept parenthesis? Ex.: Not possible (table.input_comment = or table.input_comment != None) and ... Richard -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] parenthesis in SQLFORM.grid search

2015-04-29 Thread Niphlod
is it something that requires an answer ? grid search is meant to be flexible AND user-friendly: you can come up with your own syntax and code your own search widget if you need something else On Wednesday, April 29, 2015 at 3:49:37 PM UTC+2, Richard wrote: Hello, It seems that

Re: [web2py] parenthesis in SQLFORM.grid search

2015-04-29 Thread Richard Vézina
smart_query only usage seems to be processing SQLFORM.grid search queries?? It's used in pyDAL too, but can't figure out yet what it used for. smart_query() is not documented, I can write a little docstring for it, at least specifying it main purpose?? Richard On Wed, Apr 29, 2015 at 10:53 AM,

Re: [web2py] parenthesis in SQLFORM.grid search

2015-04-29 Thread Richard Vézina
I was looking for know if it was not implemented because it was really more complex or for some other reasons... I found myself needing to pass queries trough url and I need to pass complexe where clauses which implies need for () sourrounding some queries groups... For now I have this : from