summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-01-12 17:51:28 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-01-12 17:51:28 +0000
commitd309827c757c19748ad37a4567e8ac2f2ad20c6b (patch)
tree5d581bd975decafed4df6715e2b20bd39f06b1c4 /examples
parent7fedc9298ace22df69d030c4d97169528f09f662 (diff)
downloadsqlalchemy-d309827c757c19748ad37a4567e8ac2f2ad20c6b.tar.gz
yes you can even set_value(). I'm using it to prepopulate individual "by_id" elements
from a multiple-row SELECT.
Diffstat (limited to 'examples')
-rw-r--r--examples/beaker_caching/meta.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/beaker_caching/meta.py b/examples/beaker_caching/meta.py
index 25fa1d4cf..5feecc19a 100644
--- a/examples/beaker_caching/meta.py
+++ b/examples/beaker_caching/meta.py
@@ -106,7 +106,12 @@ class CachingQuery(Query):
cache, cache_key = self._get_cache_plus_key()
cache.remove(cache_key)
-
+
+ def set_value(self, value):
+ """Set the value in the cache for this query."""
+
+ cache, cache_key = self._get_cache_plus_key()
+ cache.put(cache_key, value)
class FromCache(MapperOption):
"""A MapperOption which configures a Query to use a particular