Hi,
I'm developing a web application where users are allowed to specify
where statement. So I can capture it as a string, e.g.
( T1.C1=1 OR T1.C1=5) AND T3.C3 like 'test%'

where T1 is table 1 and C1 is column 1, and so on. Now the hard
question is how to add such string to sqlalchemy query? I've look at a
code and one possible way I see is to created a TextClause with binded
parameters. But even if I can, the hard part would be to preserve
brackets and AND/OR between different conditions. So, it should be a
way to substitue Table.Column with sqlalchemy.Column (which I can do),
and rvalues with binded names, and create a dict of binded parameters,
and just pass a string like

( T1.C1 = :param1 OR T1.C1 = :param2 ) AND T3.C3 like :param3
{'param1':1, 'param2':5,'param3':'test%'}

to given query

Is there any way to address this issue. I'll be glad if someone will
give me some guidelines.

Thanks,
Valentin.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to