Cache RPC call for class method selection
issue11793 review427971003
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
* Cache RPC call for class method selection
|
||||
|
||||
Version 6.6.0 - 2022-10-31
|
||||
--------------------------
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
|
||||
@@ -51,8 +51,9 @@ class MultiSelection(SelectionMixin, Field):
|
||||
assert hasattr(model, self.selection), \
|
||||
'Missing %s on model %s' % (self.selection, model.__name__)
|
||||
instantiate = 0 if self.selection_change_with else None
|
||||
cache = dict(days=1) if instantiate is None else None
|
||||
model.__rpc__.setdefault(
|
||||
self.selection, RPC(instantiate=instantiate))
|
||||
self.selection, RPC(instantiate=instantiate, cache=cache))
|
||||
|
||||
def get(self, ids, model, name, values=None):
|
||||
lists = {id: () for id in ids}
|
||||
|
||||
@@ -110,8 +110,9 @@ class Reference(SelectionMixin, Field):
|
||||
assert hasattr(model, self.selection), \
|
||||
'Missing %s on model %s' % (self.selection, model.__name__)
|
||||
instantiate = 0 if self.selection_change_with else None
|
||||
cache = dict(days=1) if instantiate is None else None
|
||||
model.__rpc__.setdefault(
|
||||
self.selection, RPC(instantiate=instantiate))
|
||||
self.selection, RPC(instantiate=instantiate, cache=cache))
|
||||
|
||||
def get(self, ids, model, name, values=None):
|
||||
'''
|
||||
|
||||
@@ -116,8 +116,9 @@ class Selection(SelectionMixin, Field):
|
||||
assert hasattr(model, self.selection), \
|
||||
'Missing %s on model %s' % (self.selection, model.__name__)
|
||||
instantiate = 0 if self.selection_change_with else None
|
||||
cache = dict(days=1) if instantiate is None else None
|
||||
model.__rpc__.setdefault(
|
||||
self.selection, RPC(instantiate=instantiate))
|
||||
self.selection, RPC(instantiate=instantiate, cache=cache))
|
||||
|
||||
def convert_order(self, name, tables, Model):
|
||||
if getattr(Model, 'order_%s' % name, None):
|
||||
|
||||
Reference in New Issue
Block a user