Hey all,

Does anybody have a slick way to build up sql queries for use with
SQLObject?  I've looked at the sqlbuilder documentation but I don't
see how to build it automatically (ie with multiple if statements or a
for loop).  I've also looked at the "Smart Queries" section of the
Turbogears book but it creates the queries statically.

What I'm specifically looking to do is make a search page, but I only
want to search for fields entered and I also want to AND all of the
values. Overall there will be about 10 columns that can be searched,
varying in type (BoolCol, StringCol...).

In pseudo(ish) code:

if name defined:
   whereClause.append(Request.q.name.contains(name))

if alive defined:
   whereClause.append(Request.q.alive == True)


Thanks for the help!
Chris


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

Reply via email to