Commit b5312013 authored by Julien Muchembled's avatar Julien Muchembled

"Recompile" Z SQL Methods during installation for future clean up of XML

This will allow to remove the '_arg' and 'template' attributes, which are
duplicates of 'arguments_src' and 'src'.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38356 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4019faee
......@@ -28,6 +28,7 @@
##############################################################################
import fnmatch, gc, imp, os, re, shutil, sys
from Shared.DC.ZRDB import Aqueduct
from Shared.DC.ZRDB.Connection import Connection as RDBConnection
from Products.ERP5Type.DiffUtils import DiffFile
from Products.ERP5Type.Globals import Persistent, PersistentMapping
......@@ -195,6 +196,9 @@ def fixZSQLMethod(portal, method):
'connection_id for Z SQL Method %s is invalid, using %s' % (
method.getId(), sql_connection_list[0]))
method.connection_id = sql_connection_list[0]
# recompile the method
method._arg = Aqueduct.parse(method.arguments_src)
method.template = method.template_class(method.src)
def registerSkinFolder(skin_tool, skin_folder):
request = skin_tool.REQUEST
......@@ -589,7 +593,9 @@ class BaseTemplateItem(Implicit, Persistent):
'workflow_history', '__ac_local_roles__' ]
if export:
attr_list += {
'ERP5 Python Script': ('_lazy_compilation', 'Python_magic'),
'ERP5 Python Script': (#'func_code', 'func_defaults', '_code',
'_lazy_compilation', 'Python_magic'),
#'Z SQL Method': ('_arg', 'template',),
}.get(meta_type, ())
for attr in attr_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