Commit 42826744 authored by Jérome Perrin's avatar Jérome Perrin

budget: transaction-cache BudgetLine.getAvailableBudgetDict

Eventhough _getBudgetDict was cached, getAvailableBudgetDict also
calculates getCurrentBudget for each cell, which is also heavy.
parent da208282
...@@ -111,6 +111,8 @@ class BudgetLine(Predicate, XMLMatrix, VariatedMixin): ...@@ -111,6 +111,8 @@ class BudgetLine(Predicate, XMLMatrix, VariatedMixin):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getAvailableBudgetDict') 'getAvailableBudgetDict')
@transactional_cached(key_method=lambda self, *args, **kw:
(self.getRelativeUrl(), tuple(kw.items())))
def getAvailableBudgetDict(self, **kw): def getAvailableBudgetDict(self, **kw):
"""Returns all the engagements in a dict where the keys are the cells, and """Returns all the engagements in a dict where the keys are the cells, and
the value is the engaged budget. the value is the engaged budget.
......
Markdown is supported
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