diff --git a/src/zc/zlibstorage/__init__.py b/src/zc/zlibstorage/__init__.py index bcaec15..2afccfb 100644 --- a/src/zc/zlibstorage/__init__.py +++ b/src/zc/zlibstorage/__init__.py @@ -40,6 +40,9 @@ def __init__(self, base, *args, **kw): self._transform = lambda data: data self._untransform = decompress + if hasattr(base, 'loadBeforeEx'): + self.loadBeforeEx = self._loadBeforeEx + for name in self.copied_methods: v = getattr(base, name, None) if v is not None: @@ -59,6 +62,12 @@ def load(self, oid, version=''): data, serial = self.base.load(oid, version) return self._untransform(data), serial + def _loadBeforeEx(self, oid, tid): + data, serial = self.base.loadBeforeEx(oid, tid) + if data is not None: + data = self._untransform(data) + return data, serial + def loadBefore(self, oid, tid): r = self.base.loadBefore(oid, tid) if r is not None: @@ -151,7 +160,7 @@ class ServerZlibStorage(ZlibStorage): """ copied_methods = ZlibStorage.copied_methods + ( - 'load', 'loadBefore', 'loadSerial', 'store', 'restore', + 'load', 'loadBefore', 'loadBeforeEx', 'loadSerial', 'store', 'restore', 'iterator', 'storeBlob', 'restoreBlob', 'record_iternext', )