Commit 451aa813 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix getDefaultConfigurationPropertyDict and...

fix getDefaultConfigurationPropertyDict and getDefaultConfigurationPropertyListDict implementations.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36733 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cac80dc9
...@@ -151,8 +151,8 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation): ...@@ -151,8 +151,8 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation):
configurable -- a configurable document (Solver Decision configurable -- a configurable document (Solver Decision
or Target Solver) or Target Solver)
""" """
return self._callTypeBasetMethod( return self._callTypeBasedMethod(
self, 'getDefaultConfigurationPropertyDict') configurable, 'getDefaultConfigurationPropertyDict')
def getDefaultConfigurationProperty(self, property, configurable): def getDefaultConfigurationProperty(self, property, configurable):
""" """
...@@ -175,8 +175,8 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation): ...@@ -175,8 +175,8 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation):
configurable -- a configurable document (Solver Decision configurable -- a configurable document (Solver Decision
or Target Solver) or Target Solver)
""" """
return self._callTypeBasetMethod( return self._callTypeBasedMethod(
self, 'getDefaultConfigurationPropertyListDict') configurable, 'getDefaultConfigurationPropertyListDict')
def getDefaultConfigurationPropertyList(self, property, configurable): def getDefaultConfigurationPropertyList(self, property, configurable):
""" """
...@@ -188,7 +188,7 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation): ...@@ -188,7 +188,7 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation):
""" """
return self.getDefaultConfigurationPropertyListDict().get(property, []) return self.getDefaultConfigurationPropertyListDict().get(property, [])
def _callTypeBasedMethod(self, method_id, configurable): def _callTypeBasedMethod(self, configurable, method_id):
# Implemented through type based method # Implemented through type based method
# and using read transaction cache # and using read transaction cache
portal_type = configurable.getPortalType() portal_type = configurable.getPortalType()
...@@ -206,19 +206,21 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation): ...@@ -206,19 +206,21 @@ class SolverTypeInformation(Predicate, ERP5TypeInformation):
cache = getReadOnlyTransactionCache(self) cache = getReadOnlyTransactionCache(self)
if cache is not None: if cache is not None:
key = (method_id, solver_portal_type, key = (method_id, solver_portal_type)
configurable.getRelativeUrl())
try: try:
method = cache[key] return cache[key]()
except KeyError: except KeyError:
if solver is None: pass
solver = self.getParentValue().newContent(
portal_type=solver_portal_type, if solver is None:
temp_object=True, solver = self.getParentValue().newContent(
delivery_list=configurable.getDeliveryList(), portal_type=solver_portal_type,
causality_value=configurable) temp_object=True,
method = solver._getTypeBasedMethod( delivery_list=configurable.getDeliveryList(),
method_id, causality_value=configurable)
fallback_script_id='Solver_%s' % method_id) method = solver._getTypeBasedMethod(
cache[key] = method method_id,
fallback_script_id='Solver_%s' % method_id)
if cache is not None:
cache[key] = method
return method() return method()
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