Re: [sqlalchemy] Creating Sub Object with out inserting into Base Table

2018-10-23 Thread Mike Bayer
On Tue, Oct 23, 2018 at 5:38 PM Alex Rothberg wrote: > > I have added a new sub class to my model hierarchy. I would like to > instantiate it however there will be cases where the base object / row > already exists. I tried to solve this by passing in the user object to the > StaffUser but it

[sqlalchemy] Creating Sub Object with out inserting into Base Table

2018-10-23 Thread Alex Rothberg
I have added a new sub class to my model hierarchy. I would like to instantiate it however there will be cases where the base object / row already exists. I tried to solve this by passing in the user object to the StaffUser but it looks like sqla still tried to INSERT into the User table

Re: [sqlalchemy] aliased(MyTable).my_column.comparator.table sometimes is instance of Table instead of Alias

2018-10-23 Thread Mike Bayer
On Tue, Oct 23, 2018 at 9:40 AM Stanisław Skonieczny wrote: > > Sometimes sqlalchemy produces wrong sql-s. Usually everything works fine, but > sometimes process enters somehow wrong state and then this process starts > producing wrong queries over and over again. Exception is as follows: > > >

[sqlalchemy] aliased(MyTable).my_column.comparator.table sometimes is instance of Table instead of Alias

2018-10-23 Thread Stanisław Skonieczny
Sometimes sqlalchemy produces wrong sql-s. Usually everything works fine, but sometimes process enters somehow wrong state and then this process starts producing wrong queries over and over again. Exception is as follows: (psycopg2.ProgrammingError) invalid reference to FROM-clause entry for