]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix adjacency list examples
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Jul 2008 19:44:37 +0000 (19:44 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Jul 2008 19:44:37 +0000 (19:44 +0000)
examples/adjacencytree/basic_tree.py
examples/adjacencytree/byroot_tree.py

index 65e7d0da8a025c4f6b516c056ab376e316ff3ca2..ac149d68a932c972bca92c871477c31dc06fe7fc 100644 (file)
@@ -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:"
index e57b11beec74742bb76561d650d00b80853c36b4..e4ca4295aa3ca56a1bb1d9d711f538d112c3ddce 100644 (file)
@@ -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:"