From 223229fef0efb0f04d826ff87a8813202618f727 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 29 Nov 2019 15:29:48 +0100 Subject: [PATCH 08/13] engine: cache proxy descriptor result on engine's cubes (#38067) --- bijoe/engine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bijoe/engine.py b/bijoe/engine.py index 8838f59..b44bd8c 100644 --- a/bijoe/engine.py +++ b/bijoe/engine.py @@ -232,7 +232,10 @@ class ProxyListDescriptor(object): self.chain = chain def __get__(self, obj, t=None): - return ProxyList(obj.engine, obj, self.attribute, self.cls, chain=self.chain) + key = '_proxy_list_cache_%s' % id(self) + if key not in obj.__dict__: + obj.__dict__[key] = ProxyList(obj.engine, obj, self.attribute, self.cls, chain=self.chain) + return obj.__dict__[key] class EngineCube(object): -- 2.23.0