Commit d4e425c3 authored by Aurel's avatar Aurel

use cache to be more efficient

parent cd93cec3
...@@ -33,6 +33,7 @@ from Products.ERP5Type.Core.Folder import Folder ...@@ -33,6 +33,7 @@ from Products.ERP5Type.Core.Folder import Folder
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from zLOG import LOG, INFO, ERROR, WARNING from zLOG import LOG, INFO, ERROR, WARNING
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
class IntegrationSite(Folder): class IntegrationSite(Folder):
...@@ -187,7 +188,12 @@ class IntegrationSite(Folder): ...@@ -187,7 +188,12 @@ class IntegrationSite(Folder):
base_mapping = the base property mapping base_mapping = the base property mapping
property = string of the property we want the mapping property = string of the property we want the mapping
""" """
mapping_line = base_mapping.searchFolder(portal_type='Integration Property Mapping', tv = getTransactionalVariable()
key = "%s" % (base_mapping.getPath(),)
try:
mapping_line = tv[key]
except KeyError:
tv[key] = mapping_line = base_mapping.searchFolder(portal_type='Integration Property Mapping',
path = "%s%%" %(base_mapping.getPath()), path = "%s%%" %(base_mapping.getPath()),
destination_reference=property_name, destination_reference=property_name,
) )
......
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