entity.py
changeset 9821 2077c8da1893
parent 9774 b7b71be569cf
child 9820 3ad221fe04aa
equal deleted inserted replaced
9819:95902c0b991b 9821:2077c8da1893
   549             return self.eid
   549             return self.eid
   550         return super(Entity, self).__hash__()
   550         return super(Entity, self).__hash__()
   551 
   551 
   552     def _cw_update_attr_cache(self, attrcache):
   552     def _cw_update_attr_cache(self, attrcache):
   553         # if context is a repository session, don't consider dont-cache-attrs as
   553         # if context is a repository session, don't consider dont-cache-attrs as
   554         # the instance already hold modified values and loosing them could
   554         # the instance already holds modified values and loosing them could
   555         # introduce severe problems
   555         # introduce severe problems
   556         get_set = partial(self._cw.get_shared_data, default=(), txdata=True,
   556         trdata = self._cw.transaction_data
   557                           pop=True)
   557         uncached_attrs = trdata.get('%s.storage-special-process-attrs' % self.eid, set())
   558         uncached_attrs = set()
       
   559         uncached_attrs.update(get_set('%s.storage-special-process-attrs' % self.eid))
       
   560         if self._cw.is_request:
   558         if self._cw.is_request:
   561             uncached_attrs.update(get_set('%s.dont-cache-attrs' % self.eid))
   559             uncached_attrs.update(trdata.get('%s.dont-cache-attrs' % self.eid, set()))
   562         for attr in uncached_attrs:
   560         for attr in uncached_attrs:
   563             attrcache.pop(attr, None)
   561             attrcache.pop(attr, None)
   564             self.cw_attr_cache.pop(attr, None)
   562             self.cw_attr_cache.pop(attr, None)
   565         self.cw_attr_cache.update(attrcache)
   563         self.cw_attr_cache.update(attrcache)
   566 
   564