diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-22 00:24:26 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-22 00:24:26 +0000 |
commit | bc240be3f87b41232671e4da7f59679744959154 (patch) | |
tree | 4e978300d6e796f8a476b2e6ccf543ba2e9d881f /examples/adjacencytree/byroot_tree.py | |
parent | 97feb4dbeee3ef5bc50de667ec25a43d44a5ff2c (diff) | |
download | sqlalchemy-bc240be3f87b41232671e4da7f59679744959154.tar.gz |
- attributes module and test suite moves underneath 'orm' package
- fixed table comparison example in metadata.txt
- docstrings all over the place
- renamed mapper _getattrbycolumn/_setattrbycolumn to get_attr_by_column,set_attr_by_column
- removed frommapper parameter from populate_instance(). the two operations can be performed separately
- fix to examples/adjacencytree/byroot_tree.py to fire off lazy loaders upon load, to reduce query calling
- added get(), get_by(), load() to MapperExtension
- re-implemented ExtensionOption (called by extension() function)
- redid _ExtensionCarrier to function dynamically based on __getattribute__
- added logging to attributes package, indicating the execution of a lazy callable
- going to close [ticket:329]
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 |