equal
deleted
inserted
replaced
252 # an acceptable risk. Anyway we could activate it or not according to a |
252 # an acceptable risk. Anyway we could activate it or not according to a |
253 # configuration option |
253 # configuration option |
254 |
254 |
255 def set_entity_cache(self, entity): |
255 def set_entity_cache(self, entity): |
256 """Add `entity` to the transaction entity cache""" |
256 """Add `entity` to the transaction entity cache""" |
257 try: |
257 ecache = self.data.setdefault('ecache', {}) |
258 self.data['ecache'].setdefault(entity.eid, entity) |
258 ecache.setdefault(entity.eid, entity) |
259 except KeyError: |
|
260 self.data['ecache'] = ecache = {} |
|
261 ecache[entity.eid] = entity |
|
262 |
259 |
263 def entity_cache(self, eid): |
260 def entity_cache(self, eid): |
264 """get cache entity for `eid`""" |
261 """get cache entity for `eid`""" |
265 return self.data['ecache'][eid] |
262 return self.data['ecache'][eid] |
266 |
263 |