On Sep 22, 2006, at 12:31 PM, Brian Merrell wrote: > > I've had to create four primaryjoin statements yet all of the > pertinent > information is contained in the table declaration. I understand the > initial ambiguity as I have two foreign relations to my "Person" table > and the mapper can't resolve which one is the "source" and which is > the > "object". However shouldn't we be able to assign a simple > "OnColumn=THIS" (I am making up the name since I can't find it in the > docs) which means "we know it is ambiguous because two columns have > the > same foreignkey, but we really mean THIS column". It isn't as much > the > extra typing of writing a primaryjoin but that I want to make the > table > definition more authoritative (ie I don't want to change the > foreignkey > in the table then have to remember to change the mapper to match). > Does this exist? Would it make a good feature if it doesn't?
this might be useful. but it only helps in a very narrow set of cases.....primaryjoin is not usually needed when theres a non- ambiguous foreign key relationship, and when primaryjoin is needed, many of those cases require joins that are more complex than just one column. the parameter should at least somehow be agnostic of single/ composite primary keys. im also not thrilled about adding more arguments that are essentially modified versions of a more generic argument that already exists, but i see your point about the table def driving the relationship. > Also why does the backref need a primaryjoin? We've already resolved > the ambiguity with the forward reference so why can't it just > follow it > backward to the proper column? what happens if you just make a regular "backref" without putting explicit join conditions in ? recent releases should be able to derive it from the primaryjoin/secondaryjoin arguments in the parent relation without needing it re-specified. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users