Hi, My web-application, that is in front of SQLAlchemy has various input-fields, which should act as a where-clause (with like()), a query looks e.g. like this:
session.query(MyObj).filter(table1.c.input1.like(inputfield_1+'%'), table1.c.input2.like(inputfield_2+'%'), ...) The problem is that if such an input field is empty, it should not be included in the query. If I rule out empty fields manually, I have 2^n if-clauses (I think), so I need to dynamically create the where-clauses in some way. What would be the best way to accomplish this? Best Regards, Hermann -- [EMAIL PROTECTED] GPG key ID: 299893C7 (on keyservers) FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---