comparison rhodecode/model/caching_query.py @ 1365:cd865113423e beta

applied caching query update from latest sqlalchemy
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 06 Jun 2011 17:30:34 +0200
parents e861eb1c4a2f
children
comparison
equal deleted inserted replaced
1364:b6cac385cef0 1365:cd865113423e
274 274
275 """ 275 """
276 v = [] 276 v = []
277 def visit_bindparam(bind): 277 def visit_bindparam(bind):
278 value = query._params.get(bind.key, bind.value) 278 value = query._params.get(bind.key, bind.value)
279
279 # lazyloader may dig a callable in here, intended 280 # lazyloader may dig a callable in here, intended
280 # to late-evaluate params after autoflush is called. 281 # to late-evaluate params after autoflush is called.
281 # convert to a scalar value. 282 # convert to a scalar value.
282 if callable(value): 283 if callable(value):
283 value = value() 284 value = value()
284 285
285 v.append(value) 286 v.append(value)
286 if query._criterion is not None: 287 if query._criterion is not None:
287 visitors.traverse(query._criterion, {}, {'bindparam':visit_bindparam}) 288 visitors.traverse(query._criterion, {}, {'bindparam':visit_bindparam})
288 for f in query._from_obj:
289 visitors.traverse(f, {}, {'bindparam':visit_bindparam})
290 return v 289 return v