That document is great, i follow it and get the right solution below:
orm.mapper(User, user_table, properties={
    'friends': orm.relation(User, secondary=friend_table, primaryjoin=
user_table.c.id == friend_table.c.user_id,
secondaryjoin=friends_table.c.friend_id == user_table.c.id),
    })

orm.mapper(Friend, friend_table)

Michael, thank you very much!


On Wed, Jul 22, 2009 at 9:59 PM, Michael Bayer <mike...@zzzcomputing.com>wrote:

>
> Stone Puzzle wrote:
> >
> > I got those error messages
> > ArgumentError: Could not determine join condition between parent/child
> > tables on relation Friend.user. Specify a 'primaryjoin' expression. If
> > this
> > is a many-to-many relation, 'secondaryjoin' is needed as well.
>
> primaryjoin and secondaryjoin are described at
>
> http://www.sqlalchemy.org/docs/05/mappers.html#specifying-alternate-join-conditions-to-relation
> .
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to