Re: [sqlalchemy] Re: Using operators with multiple InstrumentedAttribute instances

2019-03-29 Thread Mike Bayer
On Fri, Mar 29, 2019 at 2:31 PM Ian Miller wrote: > > The code that makes up the query builder I've been working on is pretty > extensive, so I'll go through the high-level basics. > > I've set up a `_base` method that augments the SQLALchemy Base model. Note > the column details retrived in

Re: [sqlalchemy] Re: Using operators with multiple InstrumentedAttribute instances

2019-03-29 Thread Mike Bayer
I'm not at a computer right now but what you need to do is write a simple recursive descent parser, which makes use of the objects in sqlalchemy.sql.operators for the operators as it parses the string into an expression tree. This is actually a fun classic computer problem I'm sure someone can

[sqlalchemy] Re: Using operators with multiple InstrumentedAttribute instances

2019-03-29 Thread Ian Miller
The code that makes up the query builder I've been working on is pretty extensive, so I'll go through the high-level basics. I've set up a `_base` method that augments the SQLALchemy Base model. Note the column details retrived in `get_column_and_json_key_from_sql_name` class method: class

Re: [sqlalchemy] Re: Using operators with multiple InstrumentedAttribute instances

2019-03-28 Thread Jonathan Vanasco
On Thursday, March 28, 2019 at 6:27:52 PM UTC-4, Mike Bayer wrote: > > > is this some standard thing you're both doing? I didn't see anything > about joins or query analyzing.you often have answers for > questions where I don't understand what theyre asking! > Well his question and the

Re: [sqlalchemy] Re: Using operators with multiple InstrumentedAttribute instances

2019-03-28 Thread Mike Bayer
On Thu, Mar 28, 2019 at 5:33 PM Jonathan Vanasco wrote: > > I gave up on attempts to do something similar a while back, because it became > to problematic to examine all the SqlAlchemy objects – and the existing query > – in an effort to construct the joins and query correctly. > > I would up

[sqlalchemy] Re: Using operators with multiple InstrumentedAttribute instances

2019-03-28 Thread Jonathan Vanasco
I gave up on attempts to do something similar a while back, because it became to problematic to examine all the SqlAlchemy objects – and the existing query – in an effort to construct the joins and query correctly. I would up using a two-phase approach. phase 1 analyzes the 'requested metrics'