]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
beginning of a row cycle test
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 18 Feb 2006 23:44:37 +0000 (23:44 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 18 Feb 2006 23:44:37 +0000 (23:44 +0000)
test/cycles.py

index 556008998c5b5e6a2376e6410fb3291dd2892e4b..69f632f1f4caf47c567780363f1d906125e87dd5 100644 (file)
@@ -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__":