Re: getting columns attributes in declarative style with sqlalchemy

2011-11-02 Thread Hanss
Il 01/11/2011 19.37, tres.bai...@gmail.com ha scritto: I'm no SQLAlchemy expert, but I have used the Table and Column attribute objects from the model object to solve a similar problem in the past. You can use the following syntax to do it: [col.name for col in Country.__table__.columns._all

Re: getting columns attributes in declarative style with sqlalchemy

2011-11-02 Thread Gabriele
Il 01/11/2011 19.37, tres.bai...@gmail.com ha scritto: Sorry for the repost, if it does in fact repost. I'm no SQLAlchemy expert, but I have used the Table and Column attribute objects from the model object to solve a similar problem in the past. You can use the following syntax to do it: [c

Re: getting columns attributes in declarative style with sqlalchemy

2011-11-01 Thread tres . bailey
Hi Gabriele, I'm not an Alchemy expert, but I have used the ColumnProperty of the model/column objects to solve this problem in the past. So to get the column name for the description column in your example above, you would use the following syntax: Country.description.property.columns[0].nam

Re: getting columns attributes in declarative style with sqlalchemy

2011-11-01 Thread tres . bailey
Sorry for the repost, if it does in fact repost. I'm no SQLAlchemy expert, but I have used the Table and Column attribute objects from the model object to solve a similar problem in the past. You can use the following syntax to do it: [col.name for col in Country.__table__.columns._all_cols]

getting columns attributes in declarative style with sqlalchemy

2011-10-28 Thread Gabriele
Hi, I'm tryed to write my first application using SqlAlchemy. I'm using declarative style. I need to get the attributes of the columns of my table. This is an example of my very simple model-class: class Country(base): __tablename__ = "bookings_countries" id = sqlalchemy.Column(sqlalc