Re: [sqlalchemy] nested subqueries in a hybrid expression?

2016-08-04 Thread Brian Cherinka
> > > > I've yet to see an unambiguous statement of what "the raw SQL" is. If > it is this: > > select c.pk,c.mangaid,c.manga_target_pk, n.z, > (select (array_agg(unwave.restw))[0:5] as restwave from (select > (unnest(w.wavelength)/(1+n.z)) as restw from mangadatadb.wavelength as > w) as un

Re: [sqlalchemy] nested subqueries in a hybrid expression?

2016-08-04 Thread Mike Bayer
On 08/04/2016 12:03 PM, Brian Cherinka wrote: Yeah, sorry about that. Like I said, I don't normally build my classes this way, defining all the columns in the Base Class. I define all my columns, primary and foreign keys, etc manually first, so my SQLA classes are minimally defined. And I c

Re: [sqlalchemy] nested subqueries in a hybrid expression?

2016-08-04 Thread Brian Cherinka
Yeah, sorry about that. Like I said, I don't normally build my classes this way, defining all the columns in the Base Class. I define all my columns, primary and foreign keys, etc manually first, so my SQLA classes are minimally defined. And I cobbled together pieces from my real code and y

Re: [sqlalchemy] Relationship with query time evaluated primaryjoin

2016-08-04 Thread Florian Rüchel
Awesome idea, thanks for the reply! I ended up combining this approach with the callable_ argument and don't have to explicitly pass the argument now at all. This is a great approach and it is fairly simple as well. Thank you a lot. On Friday, 5 August 2016 00:24:30 UTC+10, Mike Bayer wrote:

Re: [sqlalchemy] Relationship with query time evaluated primaryjoin

2016-08-04 Thread Mike Bayer
On 08/04/2016 10:14 AM, Florian Rüchel wrote: I have a relationship that depends on a query time variable to determine the correct join. The use case is request-time localization in a web application. When running the query during a request, I want to determine the locale and only load the tran

[sqlalchemy] Relationship with query time evaluated primaryjoin

2016-08-04 Thread Florian Rüchel
I have a relationship that depends on a query time variable to determine the correct join. The use case is request-time localization in a web application. When running the query during a request, I want to determine the locale and only load the translation for the current language for a given o