Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-05-25 Thread Julien Cigar
On Thu, Apr 26, 2018 at 11:52:48AM -0400, Mike Bayer wrote: > Attached is your script worked into separate tests. For test_five, > we can do it like this: > > > s.query(Document).filter(Document.translations.any(DocumentTranslation.body > == 'doc1_body_en')).all() > > For the tests

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-26 Thread Mike Bayer
Attached is your script worked into separate tests. For test_five, we can do it like this: s.query(Document).filter(Document.translations.any(DocumentTranslation.body == 'doc1_body_en')).all() For the tests which state "# XXX the current_translation isn't joinedloaded()", it looks

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-26 Thread Julien Cigar
Hello Mike, I finally had the time to make a little full POC, see attached file. As said previously I'm used to the old mapper() and never used the declarative until now, so forgive me if I missed something in the script.. Some explanations on the context and on what I'd like to do: It's a

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-13 Thread Julien Cigar
On Thu, Apr 12, 2018 at 08:25:06PM -0400, Mike Bayer wrote: > try sending me a long a full POC and Ill try to play with it, any yep I'll do it ..! I miss some time for now.. but it's definitively on my todo list. I don't think I have an overly complicated use case, it's just that I pay a lot of

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-12 Thread Mike Bayer
try sending me a long a full POC and Ill try to play with it, any reason you arne't using declarative? the classical mappings are hard to work with. On Wed, Apr 11, 2018 at 8:32 AM, Mike Bayer wrote: > On Wed, Apr 11, 2018 at 6:15 AM, Julien Cigar

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-11 Thread Mike Bayer
On Wed, Apr 11, 2018 at 6:15 AM, Julien Cigar wrote: > On Tue, Apr 10, 2018 at 11:53:09AM -0400, Mike Bayer wrote: >> On Tue, Apr 10, 2018 at 9:28 AM, Julien Cigar wrote: >> > Hello, >> > >> > I wondered if it is possible to use a class mapped

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-11 Thread Julien Cigar
On Tue, Apr 10, 2018 at 11:53:09AM -0400, Mike Bayer wrote: > On Tue, Apr 10, 2018 at 9:28 AM, Julien Cigar wrote: > > Hello, > > > > I wondered if it is possible to use a class mapped against multiple > > tables as a relationship() in another class? > > it is, there's

Re: [sqlalchemy] mapping a class against multiple tables + relationship() .. ?

2018-04-10 Thread Mike Bayer
On Tue, Apr 10, 2018 at 9:28 AM, Julien Cigar wrote: > Hello, > > I wondered if it is possible to use a class mapped against multiple > tables as a relationship() in another class? it is, there's examples at