]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- remove erroneous second RelationshipCache class
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Apr 2013 22:35:45 +0000 (18:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 18 Apr 2013 22:35:45 +0000 (18:35 -0400)
examples/dogpile_caching/caching_query.py

index 9a705cf31459a541c42ce59adf47f71e629b74e6..81ca310606c826df626d2f794fdc647d320e742a 100644 (file)
@@ -181,24 +181,6 @@ class FromCache(MapperOption):
         """Process a Query during normal loading operation."""
         query._cache_region = self
 
-class RelationshipCache(MapperOption):
-    """Specifies that a Query as called within a "lazy load"
-       should load results from a cache."""
-
-    propagate_to_loaders = True
-
-    def __init__(self, attribute, region="default"):
-        self.region = region
-        self.cls_ = attribute.property.parent.class_
-        self.key = attribute.property.key
-
-    def process_query_conditionally(self, query):
-        if query._current_path:
-            mapper, key = query._current_path[-2:]
-            if issubclass(mapper.class_, self.cls_) and \
-                key == self.key:
-                query._cache_region = self
-
 class RelationshipCache(MapperOption):
     """Specifies that a Query as called within a "lazy load"
        should load results from a cache."""