Uhoh, I had a little typeo, also I believe the join condition may need 
to be part of the select statement, the two conditions probably should 
be a list, and then you may need to specify the primaryjoin in the 
mapper as well.

give this a try:

a_query=select([a_table,b_table], [a_table.c.b_id==b_table.c.id, 
b_table.c.sometext!='NOTHISONE']).alias('a_query')
mapper(AObject, a_query, properties = {'B' : relation(BObject, 
primaryjoin=(b_table.c.id==a_query.c.b_id))})


Hermann Himmelbauer wrote:
> Am Dienstag 26 August 2008 01:41:20 schrieb David Gardner:
>   
>> I think what you might want to do is something like this:
>>
>> a_query=select([a_table,b_table],
>> b_table.c.sometext!='NOTHISONE').alias('a_query')
>> mapper(AObject, q_query)
>>     
>
> Interesting, thanks - yes, that might a solution, although, if I understand it
> right, this query draws the two tables together into one, right? (and q_query
> == a_query?).
>
> Best Regards,
> Hermann
>
>
> --
> [EMAIL PROTECTED]
> GPG key ID: 299893C7 (on keyservers)
> FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
>
>   


-- 
David Gardner
Pipeline Tools Programmer, "Sid the Science Kid"
Jim Henson Creature Shop
(323) 802-1717 [EMAIL PROTECTED]



--~--~---------~--~----~------------~-------~--~----~
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