Commit 2ef8db64 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add SolverDecision.getDefaultConfigurationPropertyDict().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32385 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2f682873
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import zope.interface import zope.interface
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.mixin.configurable import ConfigurableMixin from Products.ERP5.mixin.configurable import ConfigurableMixin
...@@ -88,3 +87,27 @@ class SolverDecision(ConfigurableMixin, XMLObject): ...@@ -88,3 +87,27 @@ class SolverDecision(ConfigurableMixin, XMLObject):
# Declarative interfaces # Declarative interfaces
zope.interface.implements(interfaces.IConfigurable, zope.interface.implements(interfaces.IConfigurable,
) )
def getDefaultConfigurationPropertyDict(self):
"""
Returns a dictionary of default properties for specified
configurable object
(implementation)
"""
# XXX To be implemented through type based method and using read
# transaction cache
try:
solver_portal_type = self.getSolverValue().getId()
except AttributeError:
return {}
solver = self.getParentValue().newContent(
portal_type=solver_portal_type,
temp_object=True,
delivery_list=self.getDeliveryList(),
causality_value=self)
method = solver._getTypeBasedMethod(
'getDefaultConfigurationPropertyDict',
fallback_script_id='Solver_getDefaultConfigurationPropertyDict')
return method(self)
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