Yeah, I use this use-case a lot.

I never actually search with it -- just usually map the scalar for display 
needs.

But it appear to recognize the join and automaps if needed:
  s.query(Foo).filter(Foo.qux == 'abc').first()

generates

  SELECT foo.id AS foo_id, foo.id_bar AS foo_id_bar, bar_1.id AS bar_1_id, 
bar_1.qux AS bar_1_qux 
  FROM foo LEFT OUTER JOIN bar AS bar_1 ON bar_1.id = foo.id_bar 
  WHERE EXISTS (SELECT 1 FROM bar WHERE bar.id = foo.id_bar AND bar.qux = 
'abc') LIMIT ? OFFSET ?


here's a gist:

https://gist.github.com/jvanasco/13ef28be2b746595e400


-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to