[sqlalchemy] Re: iterate through table object

2014-11-06 Thread Jonathan Vanasco
the columns are stored in a `c` attribute of the table. # available on both Class and Instance [ i for i in p.__table__.c ] [ i for i in Person.__table__.c ] # also available using sqlalchemy.orm.class_mapper # p = Person() instance dict((col.name, getattr(p, col.name)) for col in

[sqlalchemy] Re: iterate through table object

2014-11-06 Thread Jonathan Vanasco
forgot to mention: 1) i think there is a `.columns` property too, but `.c` is a shortcut. 2) there are a few more detailed explanations in the archives here and on stackoverflow 3) this is only the columns. relationships, fkeys, etc are stored differently -- You received this message because