Beispiel #1
0
 def get_from_cache(self, ome_obj):
   return self._CACHE.get(ome_hash(ome_obj))
Beispiel #2
0
 def del_from_cache(self, ome_obj):
   try:
     del self.__class__._CACHE[ome_hash(ome_obj)]
   except KeyError:
     pass
Beispiel #3
0
 def __hash__(self):
   if not self.is_mapped():
     raise TypeError("non-persistent objects are not hashable")
   return ome_hash(self.ome_obj)
Beispiel #4
0
 def store_to_cache(self, obj):
   self.__class__._CACHE[ome_hash(obj.ome_obj)] = obj
Beispiel #5
0
 def __hash__(self):
     if not self.is_mapped():
         raise TypeError("non-persistent objects are not hashable")
     return ome_hash(self.ome_obj)