557 |
557 |
558 def __cmp__(self, other): |
558 def __cmp__(self, other): |
559 raise NotImplementedError('comparison not implemented for %s' % self.__class__) |
559 raise NotImplementedError('comparison not implemented for %s' % self.__class__) |
560 |
560 |
561 def _cw_update_attr_cache(self, attrcache): |
561 def _cw_update_attr_cache(self, attrcache): |
562 for key in self._cw.get_shared_data('%s.dont-cache-attrs' % self.eid, |
562 # if context is a repository session, don't consider dont-cache-attrs as |
563 default=(), txdata=True, pop=True): |
563 # the instance already hold modified values and loosing them could |
564 attrcache.pop(key, None) |
564 # introduce severe problems |
565 self.cw_attr_cache.pop(key, None) |
565 if self._cw.is_request: |
|
566 for attr in self._cw.get_shared_data('%s.dont-cache-attrs' % self.eid, |
|
567 default=(), txdata=True, pop=True): |
|
568 attrcache.pop(attr, None) |
|
569 self.cw_attr_cache.pop(attr, None) |
566 self.cw_attr_cache.update(attrcache) |
570 self.cw_attr_cache.update(attrcache) |
567 |
571 |
568 def _cw_dont_cache_attribute(self, attr): |
572 def _cw_dont_cache_attribute(self, attr): |
569 """repository side method called when some attribute have been |
573 """repository side method called when some attribute have been |
570 transformed by a hook, hence original value should not be cached by |
574 transformed by a hook, hence original value should not be cached by |