> Different, but related question: How do I print out the statement in
> "copy-paste-able" format? More specifically, how do i get an ordered
> list of bound values out of the statement?
>
> This code does what I want, but it's really clunky and fragile:
>
> def print_statement(stmt):
>    s = str(stmt).replace("?", "%s")
>    from re import search
>    args = search("\((.*?)\)", s).group(1).split(", ")
>    print s % tuple(repr(stmt.params[arg]) for arg in args)
>
> There's also a UsageRecipe for this:
> http://www.sqlalchemy.org/trac/wiki/DebugInlineParams
>

Michael

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to