On Jun 6, 2013, at 3:21 PM, Michael Bayer <[email protected]> wrote:

> 
> Not only that, but we are now placing ORM-specific configuration into our 
> Table metadata.  What's wrong with doing it in relationship()?    Clearly, 
> the way primaryjoin works, in that it's an expression, is cumbersome.   But 
> that seems like a much easier problem to solve, just by adding some extra 
> sugar to relationship itself?  Like relationship("MyTable", 
> primaryjoin=[("a", "b"), ("c", "d")])  ?   How is that more "fiddling" than 
> the other approach?

maybe we could even go to that Place We've Never Gone (since I realized [("a", 
"b"), ("c", "d")] doesn't say anything about 'foreign'), and spell out the 
direction:

        relationship("Group", manytoone("favorite_group_id", "group_id"))

manytoone() would be some declarative sugar that expands into:

        foreign(thing.c.favorite_group_id) == remote(group.c.group_id)

at least here, we can make the case that, "these little annotations 
onetomany(), manytoone(), manytomany() are shortcuts to spelling out these 
particular joins".




-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to