On Nov 29, 2007, at 6:09 PM, Rick Morrison wrote:

> Just noticed that for mappers that use tables that do not define  
> foreign keys, specifying only 'primaryjoin='  plus 'foreign_keys='  
> doesn't seem to be sufficient to define the relationship, adding  
> 'remote_side=' fixed it.
>
> Also for such mappers, if there is a 'backref', the backref doesn't  
> seem to be able to use the foreign key relationships for the mapper,  
> it wants the 'primaryjoin=', 'foreign_keys=' and 'remote_side=' to  
> be specified all over again.
>

remote side is always needed to set up a many-to-one self-referential  
relationship.    since theres no way to distinguish between one-to- 
many or many-to-one given a join condition from a table to itself, it  
assumes one-to-many unless you flip it with remote_side.


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