]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Beaker example now takes into account 'limit'
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Feb 2011 03:30:00 +0000 (22:30 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Feb 2011 03:30:00 +0000 (22:30 -0500)
and 'offset', bind params within embedded
FROM clauses (like when you use union() or
from_self()) when generating a cache key.

CHANGES
examples/beaker_caching/caching_query.py

diff --git a/CHANGES b/CHANGES
index 7ec279ac6911938f6e6388a2e2cb78b6500d1096..16c678868076b3bd4284ae4ace0739b1d7d18484 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -29,6 +29,12 @@ CHANGES
     collection (i.e. the reverse of the 'typical'
     association proxy use case)  [ticket:2054]
 
+- examples
+  - Beaker example now takes into account 'limit'
+    and 'offset', bind params within embedded
+    FROM clauses (like when you use union() or 
+    from_self()) when generating a cache key.
+
 0.7.0b1
 =======
 - Detailed descriptions of each change below are 
index 4af812500f35a18bded13e65c0a6ba9060ecb324..4240e7e138a2fc9659d5086d2f97a12781e3e7f8 100644 (file)
@@ -121,8 +121,9 @@ def _get_cache_parameters(query):
 
     if cache_key is None:
         # cache key - the value arguments from this query's parameters.
-        args = _params_from_query(query)
-        cache_key = " ".join([str(x) for x in args])
+        args = [str(x) for x in _params_from_query(query)]
+        args.extend([str(query._limit), str(query._offset)])
+        cache_key = " ".join(args)
 
     assert cache_key is not None, "Cache key was None !"
 
@@ -269,4 +270,6 @@ def _params_from_query(query):
         v.append(value)
     if query._criterion is not None:
         visitors.traverse(query._criterion, {}, {'bindparam':visit_bindparam})
+    for f in query._from_obj:
+        visitors.traverse(f, {}, {'bindparam':visit_bindparam})
     return v