Re: [sqlalchemy] Proper labels in joins when there are multiple relationships with the same table.

2019-03-29 Thread Mike Bayer
On Fri, Mar 29, 2019 at 4:59 PM wrote: > > This is definitely along the right track but it conflicts a little bit with > the recommended pandas api, for example: > query = session.query(Account) > return pd.read_sql(query.statement, query.session.bind) > > I can still follow your method

Re: [sqlalchemy] Proper labels in joins when there are multiple relationships with the same table.

2019-03-29 Thread ghlstdios
This is definitely along the right track but it conflicts a little bit with the recommended pandas api, for example: query = session.query(Account) return pd.read_sql(query.statement, query.session.bind) I can still follow your method and add each row to a dataframe instead but its not

Re: [sqlalchemy] Proper labels in joins when there are multiple relationships with the same table.

2019-03-29 Thread Mike Bayer
On Fri, Mar 29, 2019 at 2:55 PM wrote: > > I have a model, Account, with two foreign keys / relationships to another > model, Users. > > class Account(object): > @declared_attr > def customer_id(cls): > return Column(ForeignKey(User.id)) > @declared_attr > def