# HG changeset patch # User Sylvain Thénault # Date 1250836285 -7200 # Node ID 77ebdbe93cf83316c8aabf88118d10c5fe9852ca # Parent 196493bd099c07109a00d7734ca7eea66d527c00 [entity] generic clear_all_caches methods, to use in test diff -r 196493bd099c -r 77ebdbe93cf8 entity.py --- a/entity.py Fri Aug 21 08:31:01 2009 +0200 +++ b/entity.py Fri Aug 21 08:31:25 2009 +0200 @@ -825,6 +825,11 @@ assert role self._related_cache.pop('%s_%s' % (rtype, role), None) + def clear_all_caches(self): + self.clear() + for rschema, _, role in self.e_schema.relation_definitions(): + self.clear_related_cache(rschema.type, role) + # raw edition utilities ################################################### def set_attributes(self, _cw_unsafe=False, **kwargs):