Commit 23f2f5c9 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add SolverTool.searchTargetSolverList() that returns target solver as...

add SolverTool.searchTargetSolverList() that returns target solver as predicates against a divergence tester.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36483 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 20131b88
...@@ -34,7 +34,7 @@ from Products.ERP5Type import Permissions, interfaces ...@@ -34,7 +34,7 @@ from Products.ERP5Type import Permissions, interfaces
from Products.ERP5Type.Tool.TypesTool import TypeProvider from Products.ERP5Type.Tool.TypesTool import TypeProvider
from Products.ERP5 import DeliverySolver from Products.ERP5 import DeliverySolver
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
from Products.CMFCore.utils import getToolByName
class SolverTool(TypeProvider): class SolverTool(TypeProvider):
""" The SolverTool provides API to find out which solver can be applied in """ The SolverTool provides API to find out which solver can be applied in
...@@ -198,3 +198,20 @@ class SolverTool(TypeProvider): ...@@ -198,3 +198,20 @@ class SolverTool(TypeProvider):
if test_property in property_group.getTestedPropertyList(): if test_property in property_group.getTestedPropertyList():
application_value_level[property_group.getCollectGroupOrder()] = None application_value_level[property_group.getCollectGroupOrder()] = None
# etc. same # etc. same
def searchTargetSolverList(self, divergence_tester,
tested_base_category_list=None, **kw):
"""
this method returns a list of target solvers, as predicates against
divergence tester.
"""
domain_tool = getToolByName(self.getPortalObject(), "portal_domains")
if tested_base_category_list is None:
tested_base_category_list = []
solver_list = domain_tool.searchPredicateList(
context=divergence_tester, portal_type='Solver Type',
tested_base_category_list=tested_base_category_list, **kw)
return solver_list
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