Re: [sqlalchemy] How can I filter (WHERE) on the results of a chained Selectable?

2017-01-02 Thread Thomas Vial
That makes sense. I was assuming that the WHERE clause with reference to expr.columns would involve some subquery magic, but granted, this is not easy to do in the general case (especially considering that with dotted composition the evaluation is done backwards ;-)). Thanks for your proposition;

Re: [sqlalchemy] Limiting queries from single-table inheritance declarative models

2017-01-02 Thread mike bayer
the usage of "classproperty" here suggests you're using SQLAlchemy's internal function, which has special meaning in that it gets treated like declared_attr, and you can see in INSERT it is using HybridModel for everyone. Using a different classproperty approach below the test case passes.

Re: [sqlalchemy] How can I filter (WHERE) on the results of a chained Selectable?

2017-01-02 Thread mike bayer
On 01/02/2017 11:14 AM, tvial wrote: Hi and a happy new year to all :) I am having trouble applying a WHERE clause to a chained SELECT expression, by referencing the columns of the expression itself. Hard to put in words, it's better to give an example: | fromsqlalchemy importcreate_engine fr

[sqlalchemy] Re: How can I filter (WHERE) on the results of a chained Selectable?

2017-01-02 Thread tvial
Oops forgot to tell I'm using SQLAlchemy 1.1.0 or 1.0.9 (tried both). Le lundi 2 janvier 2017 17:14:42 UTC+1, tvial a écrit : > > Hi and a happy new year to all :) > > I am having trouble applying a WHERE clause to a chained SELECT > expression, by referencing the columns of the expression itsel

[sqlalchemy] How can I filter (WHERE) on the results of a chained Selectable?

2017-01-02 Thread tvial
Hi and a happy new year to all :) I am having trouble applying a WHERE clause to a chained SELECT expression, by referencing the columns of the expression itself. Hard to put in words, it's better to give an example: from sqlalchemy import create_engine from sqlalchemy import Table, Column, Int