Glauco wrote:
I don't know if is better to use the psycopg adapter.
Can i use the funct.* function only as adapter?
example:
In [1]: aa = [1,2,3,4,]
In [2]: print sa.func.in_( *aa )
in(:in, :in_1, :in_2, :in_3)
how to obtain this?
in ( 1,2,3,4 )
perhaps you're looking for
Michael Bayer ha scritto:
Glauco wrote:
I don't know if is better to use the psycopg adapter.
Can i use the funct.* function only as adapter?
example:
In [1]: aa = [1,2,3,4,]
In [2]: print sa.func.in_( *aa )
in(:in, :in_1, :in_2, :in_3)
how to obtain this?
in ( 1,2,3,4 )
from sqlalchemy import *
aa = [1,2,3,4]
print func.in_(*[literal_column(str(x)) for x in aa])
in(1, 2, 3, 4)
this is what you asked for ?
Glauco wrote:
Michael Bayer ha scritto:
Glauco wrote:
I don't know if is better to use the psycopg adapter.
Can i use the funct.* function only
Michael Bayer ha scritto:
from sqlalchemy import *
aa = [1,2,3,4]
print func.in_(*[literal_column(str(x)) for x in aa])
in(1, 2, 3, 4)
this is what you asked for ?
Yess! well done !
I'm using the sa.func.literal_column instead of sa.literal_column...
Thank you one more