1. idank
  2. sqlalchemy


Mike Bayer  committed a5f964d

fix adjacency list examples

  • Participants
  • Parent commits 361feed
  • Branches default

Comments (0)

Files changed (2)

File examples/adjacencytree/basic_tree.py

View file
  • Ignore whitespace
 print "----------------------------"
-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:"

File examples/adjacencytree/byroot_tree.py

View file
  • Ignore whitespace
         if instance.root is instance:
-                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):
 # 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:"