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