diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-07-14 19:44:37 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-07-14 19:44:37 +0000 |
| commit | 01bce5c129cacd8717510922ef63c3d40fe9381c (patch) | |
| tree | de4de1f03f161db313e30a3f8e2d43af1320fb68 /examples | |
| parent | 05b44779a74d8ba74202c573bc68a3528c800558 (diff) | |
| download | sqlalchemy-01bce5c129cacd8717510922ef63c3d40fe9381c.tar.gz | |
fix adjacency list examples
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/adjacencytree/basic_tree.py | 2 | ||||
| -rw-r--r-- | examples/adjacencytree/byroot_tree.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/adjacencytree/basic_tree.py b/examples/adjacencytree/basic_tree.py index 65e7d0da8..ac149d68a 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 e57b11bee..e4ca4295a 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:" |
