entity.py
changeset 5573 8dfb1726526b
parent 5559 6b183d860295
child 5726 c3b99606644d
equal deleted inserted replaced
5572:df5551d697e8 5573:8dfb1726526b
   935         """clear cached values for the given relation or the entire cache if
   935         """clear cached values for the given relation or the entire cache if
   936         no relation is given
   936         no relation is given
   937         """
   937         """
   938         if rtype is None:
   938         if rtype is None:
   939             self._cw_related_cache = {}
   939             self._cw_related_cache = {}
       
   940             self._cw_adapters_cache = {}
   940         else:
   941         else:
   941             assert role
   942             assert role
   942             self._cw_related_cache.pop('%s_%s' % (rtype, role), None)
   943             self._cw_related_cache.pop('%s_%s' % (rtype, role), None)
   943 
   944 
   944     def clear_all_caches(self): # XXX cw_clear_all_caches
   945     def clear_all_caches(self): # XXX cw_clear_all_caches
   951         # clear attributes cache
   952         # clear attributes cache
   952         haseid = 'eid' in self
   953         haseid = 'eid' in self
   953         self._cw_completed = False
   954         self._cw_completed = False
   954         self.clear()
   955         self.clear()
   955         # clear relations cache
   956         # clear relations cache
   956         for rschema, _, role in self.e_schema.relation_definitions():
   957         self.cw_clear_relation_cache()
   957             self.cw_clear_relation_cache(rschema.type, role)
       
   958         # rest path unique cache
   958         # rest path unique cache
   959         try:
   959         try:
   960             del self.__unique
   960             del self.__unique
   961         except AttributeError:
       
   962             pass
       
   963         try:
       
   964             del self._cw_adapters_cache
       
   965         except AttributeError:
   961         except AttributeError:
   966             pass
   962             pass
   967 
   963 
   968     # raw edition utilities ###################################################
   964     # raw edition utilities ###################################################
   969 
   965