Esempio n. 1
0
 def load(self, oid, version):
   serial = self.__serial
   S = self.__base
   filter= lambda t, serial= serial: t['tid'] <= serial # this might need to become a picklable object, once ZEO supports 'filter'.
   if _hasSmartHistory(S):
     ts= S.history(oid, None, 1, filter= filter,)
   else:
     ts = HistoryFetcher(S, oid, None, last=1, filter=filter).next()
   if not ts: raise POSKeyError((oid, serial))
   oserial = ts[0]['tid']
   return S.loadSerial(oid, oserial), oserial
Esempio n. 2
0
  def __init__(self, storage, oid, version=None, first=0, last=None, filter=None):
    '''prepare fetching historical records for *oid* in *version*.

    Tries to find records satisfying *filter*. Records *first*
    through *last* are returned.
    '''
    S = storage
    history = S.history
    if _hasSmartHistory(S): self._smartHistory = history
    else: self._getRawHistory = history
    self._oid = oid
    self._version = version
    self._first = first
    self._last = last
    self._filter = _Filter(filter)