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 On Thursday, December 13, 2012 2:53:04 PM UTC-5, Nicolas Steinmetz wrote: > > Hello, > > Using SQLAlchemy 0.7.9 and Flask-SQLAlchhemy 0.16, I want to use Postgres > array. > > So my model is as follow : > > from sqlalchemy.dialects.postgresql import ARRAY > > class Mark(db.Model): > __tablename__ = 'mark' > > id = db.Column(db.Integer, primary_key=True) > title = db.Column(db.String(200), unique=True) > url = db.Column(db.String(200), unique=True) > description = db.Column(db.Text()) > comment = db.Column(db.Text()) > tags = db.Column(ARRAY(db.String)) > author = db.relationship('User', backref=db.backref('user', > lazy='joined')) > created_at = db.Column(db.DateTime) > updated_at = db.Column(db.DateTime) > > Creating the table works fine so I think the class definition is fine. I > inserted a few data in the database but to retrieve them, I have some issue > and can't find the right syntax for doing it right. > > Googling I found some keys but note work so far : > > - Using func.any() > - Model.column_array.op("@>")(ARRAY("hello", "world") > - and a few others. > > > Thanks in advance for your help, > Nicolas > > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/z2CRGn75Sw4J. 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.
