diff options
Diffstat (limited to 'examples/adjacencytree/byroot_tree.py')
-rw-r--r-- | examples/adjacencytree/byroot_tree.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/adjacencytree/byroot_tree.py b/examples/adjacencytree/byroot_tree.py index 6d86e587d..874ad15f2 100644 --- a/examples/adjacencytree/byroot_tree.py +++ b/examples/adjacencytree/byroot_tree.py @@ -103,6 +103,8 @@ class TreeLoader(MapperExtension): if isnew or populate_existing: parentnode = selectcontext.identity_map[mapper.identity_key(instance.parent_id)] parentnode.children.append_without_event(instance) + # fire off lazy loader before the instance is part of the session + instance.children return False class TreeData(object): @@ -117,9 +119,6 @@ print "\n\n\n----------------------------" print "Creating Tree Table:" print "----------------------------" -import logging -logging.getLogger('sqlalchemy.orm').setLevel(logging.DEBUG) - metadata.create_all() # the mapper is created with properties that specify "lazy=None" - this is because we are going |