From: Mike Bayer Date: Mon, 14 Jul 2008 19:44:37 +0000 (+0000) Subject: fix adjacency list examples X-Git-Tag: rel_0_5beta2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01bce5c129cacd8717510922ef63c3d40fe9381c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix adjacency list examples --- diff --git a/examples/adjacencytree/basic_tree.py b/examples/adjacencytree/basic_tree.py index 65e7d0da8a..ac149d68a9 100644 --- a/examples/adjacencytree/basic_tree.py +++ b/examples/adjacencytree/basic_tree.py @@ -114,7 +114,7 @@ print "tree new where node_id=%d:" % nodeid print "----------------------------" session.clear() -t = session.query(TreeNode).filter(TreeNode.c.id==nodeid)[0] +t = session.query(TreeNode).filter(TreeNode.id==nodeid)[0] print "\n\n\n----------------------------" print "Full Tree:" diff --git a/examples/adjacencytree/byroot_tree.py b/examples/adjacencytree/byroot_tree.py index e57b11beec..e4ca4295aa 100644 --- a/examples/adjacencytree/byroot_tree.py +++ b/examples/adjacencytree/byroot_tree.py @@ -89,7 +89,7 @@ class TreeLoader(MapperExtension): if instance.root is instance: connection.execute(mapper.mapped_table.update( - TreeNode.c.id==instance.id, values=dict(root_id=instance.id))) + TreeNode.id==instance.id, values=dict(root_id=instance.id))) instance.root_id = instance.id def append_result(self, mapper, selectcontext, row, instance, result, **flags): @@ -224,8 +224,8 @@ session.clear() # sub-tree in one pass. the MapperExtension will assemble the incoming # nodes into a tree structure. t = (session.query(TreeNode). - filter(TreeNode.c.root_id==nodeid). - order_by([TreeNode.c.id]))[0] + filter(TreeNode.root_id==nodeid). + order_by([TreeNode.id]))[0] print "\n\n\n----------------------------" print "Full Tree:"