Changeset - e861eb1c4a2f
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-05-15 18:22:02
marcin@python-works.com
update caching_query from latest sqlalchemy
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/caching_query.py
Show inline comments
 
@@ -107,9 +107,9 @@ class CachingQuery(Query):
 
        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 @@ def _params_from_query(query):
 

	
 
    """
 
    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 @@ def _params_from_query(query):
 

	
 
        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
0 comments (0 inline, 0 general)