Re: [sqlalchemy] auto reflect to create table declarative table code

2012-06-08 Thread Benjamin Hitz
Thank you, good sir. I was not using metadata.reflect()... but because I had defined/imported a class manually, that table and related tables were populated in metadata.tables(). .reflect() gets everything I would expect. Of course, I have already wasted 20 minutes entering the 7 tables by

[sqlalchemy] auto reflect to create table declarative table code

2012-06-06 Thread Benjamin Hitz
This seems (to me) like an obvious question but a brief googling and looking at the docs didn't seem to find the answer. I have an existing database (lets say mysql) I can easily create object like: class BroadPeaks(Base): __table__ = Table('broad_peaks', Base.metadata, autoload=True)

Re: [sqlalchemy] auto reflect to create table declarative table code

2012-06-06 Thread Michael Bayer
On Jun 6, 2012, at 7:47 PM, Benjamin Hitz wrote: This seems (to me) like an obvious question but a brief googling and looking at the docs didn't seem to find the answer. I have an existing database (lets say mysql) I can easily create object like: class BroadPeaks(Base): __table__

Re: [sqlalchemy] auto reflect to create table declarative table code

2012-06-06 Thread Benjamin Hitz
Nah, I don't want a simpler interface, I want something that just generates the code so I can extend it as needed. Ben On Jun 6, 2012, at 5:57 PM, Michael Bayer wrote: On Jun 6, 2012, at 7:47 PM, Benjamin Hitz wrote: This seems (to me) like an obvious question but a brief googling and