SQLAlchemy Column objects override the '==' operator (and many others as well) so that python expressions get converted to appropriate SQL expressions.
It's mentioned (briefly) here: http://www.sqlalchemy.org/docs/sqlconstruction.html#sql_whereclause Hope that helps, Simon > -----Original Message----- > From: sqlalchemy@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of mc > Sent: 06 July 2007 09:38 > To: sqlalchemy > Subject: [sqlalchemy] Re: Creating where clauses programatically > > > I must be missing something > Doesn't that evaluate the == expressions and result in an expression > like and_(True, True, False, ...) ? > > > On Jul 4, 1:04 am, Michael Bayer <[EMAIL PROTECTED]> wrote: > > On Jul 3, 4:06 pm, mc <[EMAIL PROTECTED]> wrote: > > > > > I managed to avoid this issues because for select and > insert I can use > > > dictionaries as arguments of execute(). > > > For update, I must create a where clause from a list of > conditions I > > > have as a dictionary. > > > How do I do this programatically? > > > > and_(*[table.c[key]==mydict[key] for key in mydict]) > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---