Re: [sqlalchemy] Add information to reflected tables

2015-04-24 Thread Jeffrey Yan
That worked perfectly, thanks! Behaves exactly the same as if I had manually defined all the tables using declarative_base. On Friday, April 24, 2015 at 10:01:49 AM UTC+12, Michael Bayer wrote: On 4/23/15 5:15 PM, Jeffrey Yan wrote: I have a couple of tables that I want to reflect. The

[sqlalchemy] Add information to reflected tables

2015-04-23 Thread Jeffrey Yan
I have a couple of tables that I want to reflect. The first is a data table where one of the columns is a foreign key to the second table. If I used SQLAlchemy declarative_base, a query might look something like this: session.query(Client.name, Suburb.label).join(Suburb) # In the Client class

Re: [sqlalchemy] Add information to reflected tables

2015-04-23 Thread Mike Bayer
On 4/23/15 5:15 PM, Jeffrey Yan wrote: I have a couple of tables that I want to reflect. The first is a data table where one of the columns is a foreign key to the second table. If I used SQLAlchemy declarative_base, a query might look something like this: |