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))
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...
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
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
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)
-
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
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,
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
8 matches
Mail list logo