get table columns from sqlAlchemy table model

You get all of the columns from __table__.columns:

myTable.__table__.columns

or

myTable.__table__.c

The columns would be in format myTable.col1 (table name is included). If you want just column names, get the .key for each column:

[column.key for column in myTable.__table__.columns]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)