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