On Sep 19, 2008, at 1:54 PM, Hans Lellelid wrote:
> >> ah. right, the parameter argument of execute() does not handle SQL >> expressions as values - the keys are used to generate a corresponding >> list of bind parameter clauses. Earlier versions of SQLA were more >> liberal in this regard but the current behavior was based around >> simplifying and improving the performance of the execute/compile >> chain. I usually use the values() method for the VALUES clause - >> table.update().where(whereclause).values(key=value, key=value). > > Thanks for the replies! -- I like the method you propose (values > clause), much clearer to me. Is that documented? In general I do > find that there are often many ways to do the same thing in SQLAlchemy > and it's not immediately clear from reading the docs (though when you > start seeing variety in the examples it does help). As I spend more > time with the tool (and figure some of these things out through trial/ > error and list responses), I'd be happy to help fill in some of the > sparse areas of the documentation. Is there a standard procedure for > submitting documentation patches? update.values() is a newer generative syntax to complement the kwarg calling form and seems like the tutorials have not been updated with this syntax as of yet. I personally prefer the generative style. the authoritative docs for API is at: http://www.sqlalchemy.org/docs/05/sqlalchemy_sql_expression.html#docstrings_sqlalchemy.sql.expression_Update , where values() is documented on the base _ValuesBase class: http://www.sqlalchemy.org/docs/05/sqlalchemy_sql_expression.html#docstrings_sqlalchemy.sql.expression__ValuesBase . documentation patches can be submitted at: http://www.sqlalchemy.org/trac/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
