[sqlalchemy] Re: Confused about relations

2007-12-12 Thread Scott Graham
> > u.Xs is going to have exactly those X's which have u's id as their > user_id attribute. the X which you appended to u.Ys[0] is from a > different relationship. so yeah you have to set the user_id attribute > on the X, which is entirely legal. However the "legit" way to do it > is to just add

[sqlalchemy] Confused about relations

2007-12-11 Thread Scott Graham
Hi (I apologize in advance if this is a silly question, but I'm having some trouble figuring out why this isn't working as expected.) I have 3 tables: Users, Xs, and Ys. Each has an id, and relevant data. Each user can have a bunch of Xs as well as a bunch of Ys, for which I have a ForeignKey("u