Re: [sqlalchemy] Setting __tablename__ at runtime?

2015-08-19 Thread Frank Horowitz
On Wednesday, August 19, 2015 at 1:24:08 AM UTC-4, Michael Bayer wrote: it doesn't work that way. The tables in your schema are supposed to be fixed. If you want to map a new class to a new table, you can do that with mixins: class Level(object): id = Column(Integer,

Re: [sqlalchemy] Setting __tablename__ at runtime?

2015-08-19 Thread jkmacc
On Tuesday, August 18, 2015 at 11:24:08 PM UTC-6, Michael Bayer wrote: On 8/18/15 8:57 PM, Frank Horowitz wrote: Hi All, A noob question, that I've been struggling with off and on for a while. I'm pretty sure that I'm missing something obvious... I'm creating tables and their entries

[sqlalchemy] Setting __tablename__ at runtime?

2015-08-18 Thread Frank Horowitz
Hi All, A noob question, that I've been struggling with off and on for a while. I'm pretty sure that I'm missing something obvious... I'm creating tables and their entries on the fly programmatically, and need to control the table names. I understand how to define declarative classes as

Re: [sqlalchemy] Setting __tablename__ at runtime?

2015-08-18 Thread Mike Bayer
On 8/18/15 8:57 PM, Frank Horowitz wrote: Hi All, A noob question, that I've been struggling with off and on for a while. I'm pretty sure that I'm missing something obvious... I'm creating tables and their entries on the fly programmatically, and need to control the table names. I