Hmmm.... in trunk browse_record class has refresh function which does what we want.
We can possibly backport this for our purposes =)
def refresh(self):
"""Force refreshing this browse_record's data and all the data of the
records that belong to the same cache, by emptying the cache completely, preserving only the record identifiers (for prefetching optimizations).
"""
for model, model_cache in self._cache.iteritems():
# only preserve the ids of the records that were in the cache cached_ids = dict([(i, {'id': i}) for i in model_cache.keys()]) self._cache[model].clear() self._cache[model].update(cached_ids)
Hmmm.... in trunk browse_record class has refresh function which does what we want.
We can possibly backport this for our purposes =)
def refresh(self):
preserving only the record identifiers (for prefetching optimizations). iteritems( ):
cached_ ids = dict([(i, {'id': i}) for i in model_cache. keys()] )
self. _cache[ model]. clear()
self. _cache[ model]. update( cached_ ids)
"""Force refreshing this browse_record's data and all the data of the
records that belong to the same cache, by emptying the cache completely,
"""
for model, model_cache in self._cache.
# only preserve the ids of the records that were in the cache