Commit a688bcdb authored by Raphael Collet's avatar Raphael Collet
Browse files

[FIX] fields: make `copy_cache` not invalidate the cache!

parent 08b28611
......@@ -64,9 +64,11 @@ def copy_cache(records, env):
for record, target in zip(records, records.with_env(env)):
if not target._cache:
for name, value in record._cache.iteritems():
target[name] = value
if isinstance(value, BaseModel):
target._cache[name] = value.with_env(env)
copy_cache(value, env)
else:
target._cache[name] = value
def resolve_all_mro(cls, name, reverse=False):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment