Commit dea96c61 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Imports deferred to remove circular imports.

While trying to use module `Products.ERP5.Core.Folder` in ZSQLCatalog,
circular dependencies in Base caused error, so for testing we try to
defer the imports to local context where they are specifically needed.
parent 9179cdbb
......@@ -254,7 +254,6 @@ DCWorkflowDefinition.listObjectActions = DCWorkflowDefinition_listObjectActions
from Products.DCWorkflow.Expression import Expression
from Products.ERP5Type.patches.WorkflowTool import SECURITY_PARAMETER_ID, WORKLIST_METADATA_KEY
def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info,
check_guard=True):
"""
......@@ -262,6 +261,7 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info,
(worklist id as key) and which value is a dict composed of
variable matches.
"""
from Products.ERP5Type.patches.WorkflowTool import SECURITY_PARAMETER_ID, WORKLIST_METADATA_KEY
if not self.worklists:
return None
......
......@@ -30,7 +30,6 @@ from Products.DCWorkflow.utils import Message as _
from Products.DCWorkflow.Transitions import TRIGGER_USER_ACTION
from Products.CMFCore.utils import getToolByName
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, AutoQuery, ComplexQuery, NegatedQuery
from Products.CMFCore.utils import _getAuthenticatedUser
from Products.ERP5Type import Permissions
from Products.ERP5Type.Cache import CachingMethod
......@@ -253,6 +252,7 @@ def generateNestedQuery(getQuery, priority_list, criterion_dict,
possible_worklist_id_dict=None):
"""
"""
from Products.ZSQLCatalog.SQLCatalog import NegatedQuery, ComplexQuery
assert possible_worklist_id_dict is None \
or len(possible_worklist_id_dict) != 0
my_priority_list = priority_list[:]
......@@ -458,6 +458,7 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False):
Related keys are supported.
Warning: the worklist cache does not support them.
"""
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, AutoQuery
if object is not None or info is None:
info = self._getOAI(object)
chain = self.getChainFor(info.object)
......@@ -624,6 +625,7 @@ def WorkflowTool_refreshWorklistCache(self):
- insert new lines
- if it fails, recrete the table and retry
"""
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery
# Contrary to WorkflowTool_listActions, related keys are NOT supported.
Base_zInsertIntoWorklistTable = getattr(self, 'Base_zInsertIntoWorklistTable', None)
if Base_zInsertIntoWorklistTable is not None:
......
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