Commits

Mike Bayer committed a5f964d

fix adjacency list examples

Comments (0)

Files changed (2)

examples/adjacencytree/basic_tree.py

 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:"

examples/adjacencytree/byroot_tree.py

 
         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):
 # 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:"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.