Commit 016c3d73 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

initial implementation of getDefaultConfigurationPropertyDict.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32303 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 977c20d0
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.ERP5Type import ERP5TypeInformation from Products.ERP5Type.ERP5Type import ERP5TypeInformation
from Products.ERP5Type.Cache import getReadOnlyTransactionCache
class SolverTypeInformation(ERP5TypeInformation): class SolverTypeInformation(ERP5TypeInformation):
""" """
...@@ -82,6 +83,25 @@ class SolverTypeInformation(ERP5TypeInformation): ...@@ -82,6 +83,25 @@ class SolverTypeInformation(ERP5TypeInformation):
""" """
# Implemented through type based method # Implemented through type based method
# and using read transaction cache # and using read transaction cache
if configurable.getPortalType() == 'Solver Decision':
try:
solver_portal_type = configurable.getSolverValue().getId()
except AttributeError:
return {}
else:
solver_portal_type = configurable.getPortalType()
cache = getReadOnlyTransactionCache(self)
if cache is not None:
key = ('getDefaultConfigurationPropertyDict', solver_portal_type)
try:
method = cache[key]
except KeyError:
method = self._getTypeBasedMethod(
'getDefaultConfigurationPropertyDict',
fallback_script_id='Solver_getDefaultConfigurationPropertyDict')
cache[key] = method
return method(configurable)
def getDefaultConfigurationPropertyList(self, id, configurable): def getDefaultConfigurationPropertyList(self, id, configurable):
""" """
......
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