Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-25 Thread Mike Bayer
On Tue, Jun 25, 2019, at 10:30 PM, Julien Cigar wrote: > Just to add that it works like a charm, even with recursive queries. > I have a classical parent->child relationship (website structure) and I > am able to retrieve the whole structure, including translations (with > fallback on a default

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-25 Thread Julien Cigar
Just to add that it works like a charm, even with recursive queries. I have a classical parent->child relationship (website structure) and I am able to retrieve the whole structure, including translations (with fallback on a default one) in just _one_ query, this is really amazing :) this is with

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-21 Thread Julien Cigar
On Thursday, June 20, 2019 at 4:24:14 PM UTC+2, Mike Bayer wrote: > > > > On Thu, Jun 20, 2019, at 8:39 AM, Julien Cigar wrote: > > > > On Wednesday, June 19, 2019 at 9:53:42 PM UTC+2, Mike Bayer wrote: > > > > On Wed, Jun 19, 2019, at 10:50 AM, Julien Cigar wrote: > > That's the (almost) final

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-20 Thread Mike Bayer
On Thu, Jun 20, 2019, at 8:39 AM, Julien Cigar wrote: > > > On Wednesday, June 19, 2019 at 9:53:42 PM UTC+2, Mike Bayer wrote: >> >> >> On Wed, Jun 19, 2019, at 10:50 AM, Julien Cigar wrote: >>> That's the (almost) final version if you're interrested: >>>

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-20 Thread Julien Cigar
On Wednesday, June 19, 2019 at 9:53:42 PM UTC+2, Mike Bayer wrote: > > > > On Wed, Jun 19, 2019, at 10:50 AM, Julien Cigar wrote: > > That's the (almost) final version if you're interrested: > https://gist.github.com/silenius/568aca7545e1bc0400b53b6ec157807d > > > great, I can't run it, so are

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-19 Thread Mike Bayer
On Wed, Jun 19, 2019, at 10:50 AM, Julien Cigar wrote: > That's the (almost) final version if you're interrested: > https://gist.github.com/silenius/568aca7545e1bc0400b53b6ec157807d great, I can't run it, so are you still getting any warnings about properties being overwritten ? > > On

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-19 Thread Julien Cigar
That's the (almost) final version if you're interrested: https://gist.github.com/silenius/568aca7545e1bc0400b53b6ec157807d On Wednesday, June 19, 2019 at 4:44:55 PM UTC+2, Julien Cigar wrote: > > > > On Wednesday, June 19, 2019 at 4:09:55 PM UTC+2, Mike Bayer wrote: >> >> >> >> On Wed, Jun 19,

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-19 Thread Julien Cigar
On Wednesday, June 19, 2019 at 4:09:55 PM UTC+2, Mike Bayer wrote: > > > > On Wed, Jun 19, 2019, at 4:48 AM, Julien Cigar wrote: > > Thank you very much, it almost works ! > > I have one minor issue, as translation_cls is involved in joined load > inheritance the select([translation_cls], ...)

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-19 Thread Julien Cigar
adding use_labels=True to the select fixed the problem :) On Wednesday, June 19, 2019 at 10:47:57 AM UTC+2, Julien Cigar wrote: > > Thank you very much, it almost works ! > > I have one minor issue, as translation_cls is involved in joined load > inheritance the select([translation_cls], ...)

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-19 Thread Mike Bayer
On Wed, Jun 19, 2019, at 4:48 AM, Julien Cigar wrote: > Thank you very much, it almost works ! > > I have one minor issue, as translation_cls is involved in joined load > inheritance the select([translation_cls], ...) results in: > > SELECT > content_translation.language_id AS language_id,

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-19 Thread Julien Cigar
Thank you very much, it almost works ! I have one minor issue, as translation_cls is involved in joined load inheritance the select([translation_cls], ...) results in: SELECT content_translation.language_id AS language_id,

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-18 Thread Mike Bayer
This test doesn't run yet because it looks like you need to have initializers for things like Content.current_translation, the setup_class fails right now because that isn't handled. In any case, adapting the window recipe from

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-18 Thread Julien Cigar
Hello Mike, As always thank you for your quick and useful reply. I might not need LATERAL but would be very interrested to see a solution with WINDOW functions .. I've added a small test case with some comment on what I'd like to achieve. Basically what I would like is to be able to select

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-18 Thread Mike Bayer
On Tue, Jun 18, 2019, at 6:21 AM, Julien Cigar wrote: > Hello, > > I'm trying to add a 'read-only' relationship involving a subquery and I have > some problems with remote and foreign sides, SQLAlchemy returns: > > sqlalchemy.exc.ArgumentError: Relationship Folder.current_translation could >