Re: [sqlalchemy] issue with joineload and multiple relationships to the same table

2017-04-21 Thread Jonathan Vanasco
Thanks. That's exactly it. It makes perfect sense why it just happens to work when I join one bar onto this, but not two. FYI, I'm not seeing a comma on the simple join - but it's still a bad query that illustrates the problem as Bar doesn't get joined in: SELECT foo.id AS foo_id FROM foo

Re: [sqlalchemy] issue with joineload and multiple relationships to the same table

2017-04-21 Thread mike bayer
On 04/20/2017 09:12 PM, Jonathan Vanasco wrote: i have roughly the following model: Widget > Widget2Foo > Foo > Foo2Bar > Bar wherein `Foo` has multiple relationships to `Bar` (via a filter ) the setup works for lazyloading and subqueryloading, but I can't do multiple joinedloads: eg:

Re: [sqlalchemy] Apparent bug when combining not_() and label() in expression language

2017-04-21 Thread mike bayer
On 04/20/2017 03:39 PM, George London wrote: I noticed some strange behavior while using the SQLAlchemy expression language. I'm using Python 3.5 and SQLAlchemy 1.1.19 against MySQL 5.7.13 via the mysqlclient v1.3.10 connector. The problem happens when I build up a boolean expression using

Re: [sqlalchemy] autogenerate migrations with alembic for inherited tables

2017-04-21 Thread mike bayer
On 04/21/2017 09:16 AM, Антонио Антуан wrote: Helllo. I have a model, with specified __tablename__ = 'base_table'. In postgresql, the table has trigger, which executes before each insert: it creates partition for current month (if it not exist yet), specifies "INHERITS (base_table)" for new

Re: [sqlalchemy] IntegrityError following the tutorial using OracleDB

2017-04-21 Thread mike bayer
On 04/21/2017 04:30 AM, Simon King wrote: On Fri, Apr 21, 2017 at 1:52 AM, Matei Micu wrote: I'm following the tutorial from http://docs.sqlalchemy.org/en/latest/orm/tutorial.html , from my understanding the primary key should be added when a session flushes the content

[sqlalchemy] autogenerate migrations with alembic for inherited tables

2017-04-21 Thread Антонио Антуан
Helllo. I have a model, with specified __tablename__ = 'base_table'. In postgresql, the table has trigger, which executes before each insert: it creates partition for current month (if it not exist yet), specifies "INHERITS (base_table)" for new partition and insert data into it. Is there any