Getting a list of parameters from a select object

10 views
Skip to first unread message

Samuel

unread,
Nov 29, 2007, 10:31:42 AM11/29/07
to sqlalchemy
Hi,

I am trying to get a list of parameters from a Select object. In other
words, given the following code:

select = table.select(or_(table.c.id == "10", table.c.name == "test"))

I am trying to get the following list: ["10", "test"]. I tried
"select.compile().parameters", which returns None.
Any hints?

-Samuel

Michael Bayer

unread,
Nov 29, 2007, 10:49:08 AM11/29/07
to sqlal...@googlegroups.com

assuming youre using 0.3 youd have to call
select.compile().construct_params({}). in 0.4 youre looking for the
"params" collection, where there is no "parameters" attribute.


Samuel

unread,
Nov 29, 2007, 11:09:59 AM11/29/07
to sqlalchemy
On Nov 29, 4:49 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> assuming youre using 0.3 youd have to call
> select.compile().construct_params({}).

The method doesn't exist (at least not in the MySQL engine I am using
(with sqlalchemy 0.3)), but while looking for the correct name I found
that

request.compile().get_params()

returns a dict that contains all the information I need.

Thanks!
-Samuel
Reply all
Reply to author
Forward
0 new messages