From: Mike Bayer Date: Sat, 18 Feb 2006 23:44:37 +0000 (+0000) Subject: beginning of a row cycle test X-Git-Tag: rel_0_1_1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d34584032171a57572ada8b762253769990b946f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git beginning of a row cycle test --- diff --git a/test/cycles.py b/test/cycles.py index 556008998c..69f632f1f4 100644 --- a/test/cycles.py +++ b/test/cycles.py @@ -228,6 +228,28 @@ class CycleTest2(AssertMixin): p.balls.append(b) objectstore.commit() + def testrowcycle(self): + """tests a cycle between two rows""" + class Person(object): + pass + + class Ball(object): + pass + + Ball.mapper = mapper(Ball, ball) + Person.mapper = mapper(Person, person, properties= dict( + balls = relation(Ball.mapper, primaryjoin=ball.c.person_id==person.c.id, foreignkey=ball.c.person_id), + favorateBall = relation(Ball.mapper, primaryjoin=person.c.favoriteBall_id==ball.c.id, foreignkey=person.c.favoriteBall_id), + ) + ) + + print str(Person.mapper.props['balls'].primaryjoin) + + b = Ball() + p = Person() + p.balls.append(b) + p.favorateBall = b + #objectstore.commit() if __name__ == "__main__":