I am trying to figure out the correct join query setup within SQLAlchemy, 
but I can't seem to get my head around it.

I have the following table setup (simplified, I left out the non-essential 
fields):

[image: Unbenannt.png]

[image: Unbenannt2.png]

The facts are associated to info, info is associated to text. Text and 
facts aren't directly associated.

I would like to join them all together but can't figure out to do so.

In this example I would like to get all instaces of "Info" that are 
associated to Fact.id = 1 and all "Text" instances that are associated to 
that "Info" instance. I came up with
     select(Info, Text)
          .join(facts_info)
          .join(Facts)
          .join(info_text)
          .join(Text)
          here(Facts.id ==1) 

But it obviously gives me an error.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/59a98354-4ecf-4b4b-b76b-a8ad67aae207n%40googlegroups.com.

Reply via email to