if youre adding ClauseElements to select_by, all the "automatic
joining" logic does not take effect for those.

By ClauseElement, i mean when you say:

select_by(someclass.c.somecol == 'somevalue')

the "==" operation produces a new object called a ClauseElement, and is
passed to the select_by function as a positional argument (i.e. using
*args).  it is *not* the same as saying:

select_by(somecol='somevalue')

which is a keyword argument (i.e. using **kwargs).  in that version,
'somecol' is interpreted as a mapped property, not a column, and can be
reconciled against its role in the mapper relationship (i.e. it figures
out the joins).

if you want to use ClauseElements and also have joining, look into
using the select() method with a combination of join_by/join_via.  For
this kind of thing also, I find the SelectResults extension makes it
easier.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to