From: Mike Bayer Date: Tue, 12 Jan 2010 17:51:28 +0000 (+0000) Subject: yes you can even set_value(). I'm using it to prepopulate individual "by_id" elements X-Git-Tag: rel_0_6beta1~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d309827c757c19748ad37a4567e8ac2f2ad20c6b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git yes you can even set_value(). I'm using it to prepopulate individual "by_id" elements from a multiple-row SELECT. --- diff --git a/examples/beaker_caching/meta.py b/examples/beaker_caching/meta.py index 25fa1d4cf1..5feecc19a9 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