Given
class Person:
id
 class Topic:
id
 class Person2Topic :
id 
topic_id  - fkeys topic(id)
person_id - fkeys person(id)
 class Message:
id
person_id_author - fkeys person(id)
topic_id - fkeys topic(id)
 I wanted to select by joining the Person2Topic table directly, with a 
filter

query( Message )\
join(  Person2Topic ,(
Message.topic_id == Person2Topic.topic_id ,
Person2Topic.person_id = 1  
)

This generates errors, because sqlalchemy doesn't have an fkey on 
Message.topic_id = Person2Topic.topic_id
i can only figure out how to do query by doing intermediary joins

query( Message )\
join( Topic , ( Message.topic_id == Topic.id ) )\
join(  Person2Topic ,( Topic.id = Person2Topic.topic_id )\
filter( Person2Topic.person_id = 1 )

is it possible to do a select like I originally wanted ?
 

-- 
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 post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to