On Thu, 2012-12-13 at 12:46:28 -0800, Michael Bayer wrote: > the "array()" function builds an ad-hoc array, its separate from the ARRAY > type. > > Using 0.8.0b1 (full release is soon) we have improved support for ARRAY: > > http://docs.sqlalchemy.org/en/rel_0_8/dialects/postgresql.html?highlight=array#sqlalchemy.dialects.postgresql.ARRAY > > http://docs.sqlalchemy.org/en/rel_0_8/dialects/postgresql.html?highlight=array#sqlalchemy.dialects.postgresql.array
In 0.7.9 (using psycopg2 as DBAPI driver) this works:
db.session.query(Mark.tags).filter(Mark.tags.op('@>')(['foo'])).all()
Although in 0.8 it would look nicer:
db.session.query(Mark.tags).filter(Mark.tags.contains(['foo'])).all()
--
Audrius Kažukauskas
http://neutrino.lt/
pgpMP658DTbXp.pgp
Description: PGP signature
