]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
compare class in the given path with our own class using issubclass, since paths
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 11 Jan 2010 17:12:04 +0000 (17:12 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 11 Jan 2010 17:12:04 +0000 (17:12 +0000)
are always against the base class

examples/beaker_caching/meta.py

index 3483a96fc81b8b64c12d6dd45f93bdb210fc5054..40927cda7f5c8a7434b8508ab9fad6e4d71e4691 100644 (file)
@@ -157,7 +157,7 @@ class FromCache(MapperOption):
         """
         if self.cls_ is not None and query._current_path:
             mapper, key = query._current_path[-2:]
-            if mapper.class_ is self.cls_ and key == self.propname:
+            if issubclass(self.cls_, mapper.class_) and key == self.propname:
                 self._set_query_cache(query)
 
     def process_query(self, query):