changeset 1339:e861eb1c4a2f beta

update caching_query from latest sqlalchemy
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 15 May 2011 18:22:02 +0200
parents bbfc3f305c6b
children cbdd583f1e58
files rhodecode/model/caching_query.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/caching_query.py	Sun May 15 18:20:53 2011 +0200
+++ b/rhodecode/model/caching_query.py	Sun May 15 18:22:02 2011 +0200
@@ -107,9 +107,9 @@
         cache.put(cache_key, value)
 
 
-def query_callable(manager):
+def query_callable(manager, query_cls=CachingQuery):
     def query(*arg, **kw):
-        return CachingQuery(manager, *arg, **kw)
+        return query_cls(manager, *arg, **kw)
     return query
 
 
@@ -274,10 +274,8 @@
 
     """
     v = []
-
     def visit_bindparam(bind):
         value = query._params.get(bind.key, bind.value)
-
         # lazyloader may dig a callable in here, intended
         # to late-evaluate params after autoflush is called.
         # convert to a scalar value.
@@ -286,5 +284,7 @@
 
         v.append(value)
     if query._criterion is not None:
-        visitors.traverse(query._criterion, {}, {'bindparam': visit_bindparam})
+        visitors.traverse(query._criterion, {}, {'bindparam':visit_bindparam})
+    for f in query._from_obj:
+        visitors.traverse(f, {}, {'bindparam':visit_bindparam})
     return v