def with_cache_key(self, cachekey):
self.cachekey = cachekey
- # override the _clone() method. a future release
- # will just fix _clone() in Query to not hardcode the class so this won't be needed.
- def _clone(self):
- q = CachingQuery.__new__(CachingQuery)
- q.__dict__ = self.__dict__.copy()
- return q
-
# single point of object loading is __iter__(). objects in the cache are not associated
# with a session and are never returned directly; only merged copies.
def __iter__(self):
self.query_chooser = self.session.query_chooser
self._shard_id = None
- def _clone(self):
- q = ShardedQuery.__new__(ShardedQuery)
- q.__dict__ = self.__dict__.copy()
- return q
-
def set_shard(self, shard_id):
"""return a new query, limited to a single shard ID.