]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- restored logging of "lazy loading clause" under sa.orm.strategies logger,
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 20 May 2007 18:22:48 +0000 (18:22 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 20 May 2007 18:22:48 +0000 (18:22 +0000)
got removed in 0.3.7

CHANGES
lib/sqlalchemy/orm/strategies.py

diff --git a/CHANGES b/CHANGES
index e7938bdc8579411a7f66e70c8e0f8f382de8fbd9..74c818c150f65c58b0a90ebd2207b55c8696d0a6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -37,6 +37,8 @@
     - the "primary_key" argument to mapper() is propigated to the "polymorphic"
       mapper.  primary key columns in this list get normalized to that of the mapper's 
       local table.
+    - restored logging of "lazy loading clause" under sa.orm.strategies logger,
+      got removed in 0.3.7
 - mysql
     - support for column-level CHARACTER SET and COLLATE declarations,
       as well as ASCII, UNICODE, NATIONAL and BINARY shorthand.
index f1b159318f374fa5567842fed5e22c82a5e1c3b4..a1f88355def082b8205799abdb847d48f0201086 100644 (file)
@@ -166,6 +166,8 @@ class LazyLoader(AbstractRelationLoader):
         # determine if our "lazywhere" clause is the same as the mapper's
         # get() clause.  then we can just use mapper.get()
         self.use_get = not self.uselist and query.Query(self.mapper)._get_clause.compare(self.lazywhere)
+        if self.use_get:
+            self.logger.info(str(self.parent_property) + " will use query.get() to optimize instance loads")
 
     def init_class_attribute(self):
         self._register_attribute(self.parent.class_, callable_=lambda i: self.setup_loader(i))
@@ -303,8 +305,7 @@ class LazyLoader(AbstractRelationLoader):
                 li.traverse(secondaryjoin)
             lazywhere = sql.and_(lazywhere, secondaryjoin)
  
-        if hasattr(cls, 'parent_property'):
-            LazyLoader.logger.info(str(cls.parent_property) + " lazy loading clause " + str(lazywhere))
+        LazyLoader.logger.info(str(prop.parent_property) + " lazy loading clause " + str(lazywhere))
         return (lazywhere, binds, reverse)
     _create_lazy_clause = classmethod(_create_lazy_clause)