Commit 2a7a469a authored by Aurel's avatar Aurel

remove unneeded properties for catalog method


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4836 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a9da97aa
...@@ -1115,10 +1115,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1115,10 +1115,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
def __init__(self, id_list, tool_id='portal_catalog', **kw): def __init__(self, id_list, tool_id='portal_catalog', **kw):
ObjectTemplateItem.__init__(self, id_list, tool_id=tool_id, **kw) ObjectTemplateItem.__init__(self, id_list, tool_id=tool_id, **kw)
# self._is_catalog_method_archive = PersistentMapping()
self._is_catalog_list_method_archive = PersistentMapping() self._is_catalog_list_method_archive = PersistentMapping()
self._is_uncatalog_method_archive = PersistentMapping() self._is_uncatalog_method_archive = PersistentMapping()
# self._is_update_method_archive = PersistentMapping()
self._is_clear_method_archive = PersistentMapping() self._is_clear_method_archive = PersistentMapping()
self._is_filtered_archive = PersistentMapping() self._is_filtered_archive = PersistentMapping()
self._filter_expression_archive = PersistentMapping() self._filter_expression_archive = PersistentMapping()
...@@ -1136,10 +1134,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1136,10 +1134,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
return return
for obj in self._objects.values(): for obj in self._objects.values():
method_id = obj.id method_id = obj.id
# self._is_catalog_method_archive[method_id] = method_id in catalog.sql_catalog_object
self._is_catalog_list_method_archive[method_id] = method_id in catalog.sql_catalog_object_list self._is_catalog_list_method_archive[method_id] = method_id in catalog.sql_catalog_object_list
self._is_uncatalog_method_archive[method_id] = method_id in catalog.sql_uncatalog_object self._is_uncatalog_method_archive[method_id] = method_id in catalog.sql_uncatalog_object
# self._is_update_method_archive[method_id] = method_id in catalog.sql_update_object
self._is_clear_method_archive[method_id] = method_id in catalog.sql_clear_catalog self._is_clear_method_archive[method_id] = method_id in catalog.sql_clear_catalog
self._is_filtered_archive[method_id] = 0 self._is_filtered_archive[method_id] = 0
if catalog.filter_dict.has_key(method_id): if catalog.filter_dict.has_key(method_id):
...@@ -1203,10 +1199,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1203,10 +1199,8 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
LOG('BusinessTemplate', 0, 'no SQL catalog was available') LOG('BusinessTemplate', 0, 'no SQL catalog was available')
return return
# Make copies of attributes of the default catalog of portal_catalog. # Make copies of attributes of the default catalog of portal_catalog.
# sql_catalog_object = list(catalog.sql_catalog_object)
sql_catalog_object_list = list(catalog.sql_catalog_object_list) sql_catalog_object_list = list(catalog.sql_catalog_object_list)
sql_uncatalog_object = list(catalog.sql_uncatalog_object) sql_uncatalog_object = list(catalog.sql_uncatalog_object)
# sql_update_object = list(catalog.sql_update_object)
sql_clear_catalog = list(catalog.sql_clear_catalog) sql_clear_catalog = list(catalog.sql_clear_catalog)
update_dict = kw.get('object_to_update') update_dict = kw.get('object_to_update')
...@@ -1238,18 +1232,11 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1238,18 +1232,11 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
for obj in values: for obj in values:
method_id = obj.id method_id = obj.id
# is_catalog_method = int(self._is_catalog_method_archive[method_id])
is_catalog_list_method = int(self._is_catalog_list_method_archive[method_id]) is_catalog_list_method = int(self._is_catalog_list_method_archive[method_id])
is_uncatalog_method = int(self._is_uncatalog_method_archive[method_id]) is_uncatalog_method = int(self._is_uncatalog_method_archive[method_id])
# is_update_method = int(self._is_update_method_archive[method_id])
is_clear_method = int(self._is_clear_method_archive[method_id]) is_clear_method = int(self._is_clear_method_archive[method_id])
is_filtered = int(self._is_filtered_archive[method_id]) is_filtered = int(self._is_filtered_archive[method_id])
# if is_catalog_method and method_id not in sql_catalog_object:
# sql_catalog_object.append(method_id)
# elif not is_catalog_method and method_id in sql_catalog_object:
# sql_catalog_object.remove(method_id)
if is_catalog_list_method and method_id not in sql_catalog_object_list: if is_catalog_list_method and method_id not in sql_catalog_object_list:
sql_catalog_object_list.append(method_id) sql_catalog_object_list.append(method_id)
elif not is_catalog_list_method and method_id in sql_catalog_object_list: elif not is_catalog_list_method and method_id in sql_catalog_object_list:
...@@ -1260,11 +1247,6 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1260,11 +1247,6 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
elif not is_uncatalog_method and method_id in sql_uncatalog_object: elif not is_uncatalog_method and method_id in sql_uncatalog_object:
sql_uncatalog_object.remove(method_id) sql_uncatalog_object.remove(method_id)
# if is_update_method and method_id not in sql_update_object:
# sql_update_object.append(method_id)
# elif not is_update_method and method_id in sql_update_object:
# sql_update_object.remove(method_id)
if is_clear_method and method_id not in sql_clear_catalog: if is_clear_method and method_id not in sql_clear_catalog:
sql_clear_catalog.append(method_id) sql_clear_catalog.append(method_id)
elif not is_clear_method and method_id in sql_clear_catalog: elif not is_clear_method and method_id in sql_clear_catalog:
...@@ -1285,14 +1267,10 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1285,14 +1267,10 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
elif method_id in catalog.filter_dict.keys(): elif method_id in catalog.filter_dict.keys():
catalog.filter_dict[method_id]['filtered'] = 0 catalog.filter_dict[method_id]['filtered'] = 0
# sql_catalog_object.sort()
# catalog.sql_catalog_object = tuple(sql_catalog_object)
sql_catalog_object_list.sort() sql_catalog_object_list.sort()
catalog.sql_catalog_object_list = tuple(sql_catalog_object_list) catalog.sql_catalog_object_list = tuple(sql_catalog_object_list)
sql_uncatalog_object.sort() sql_uncatalog_object.sort()
catalog.sql_uncatalog_object = tuple(sql_uncatalog_object) catalog.sql_uncatalog_object = tuple(sql_uncatalog_object)
# sql_update_object.sort()
# catalog.sql_update_object = tuple(sql_update_object)
sql_clear_catalog.sort() sql_clear_catalog.sort()
catalog.sql_clear_catalog = tuple(sql_clear_catalog) catalog.sql_clear_catalog = tuple(sql_clear_catalog)
...@@ -1316,31 +1294,23 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1316,31 +1294,23 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
else: else:
values.append(self._archive[object_path]) values.append(self._archive[object_path])
# Make copies of attributes of the default catalog of portal_catalog. # Make copies of attributes of the default catalog of portal_catalog.
# sql_catalog_object = list(catalog.sql_catalog_object)
sql_catalog_object_list = list(catalog.sql_catalog_object_list) sql_catalog_object_list = list(catalog.sql_catalog_object_list)
sql_uncatalog_object = list(catalog.sql_uncatalog_object) sql_uncatalog_object = list(catalog.sql_uncatalog_object)
# sql_update_object = list(catalog.sql_update_object)
sql_clear_catalog = list(catalog.sql_clear_catalog) sql_clear_catalog = list(catalog.sql_clear_catalog)
for obj in values: for obj in values:
method_id = obj.id method_id = obj.id
# if method_id in sql_catalog_object:
# sql_catalog_object.remove(method_id)
if method_id in sql_catalog_object_list: if method_id in sql_catalog_object_list:
sql_catalog_object_list.remove(method_id) sql_catalog_object_list.remove(method_id)
if method_id in sql_uncatalog_object: if method_id in sql_uncatalog_object:
sql_uncatalog_object.remove(method_id) sql_uncatalog_object.remove(method_id)
# if method_id in sql_update_object:
# sql_update_object.remove(method_id)
if method_id in sql_clear_catalog: if method_id in sql_clear_catalog:
sql_clear_catalog.remove(method_id) sql_clear_catalog.remove(method_id)
if catalog.filter_dict.has_key(method_id): if catalog.filter_dict.has_key(method_id):
del catalog.filter_dict[method_id] del catalog.filter_dict[method_id]
# catalog.sql_catalog_object = tuple(sql_catalog_object)
catalog.sql_catalog_object_list = tuple(sql_catalog_object_list) catalog.sql_catalog_object_list = tuple(sql_catalog_object_list)
catalog.sql_uncatalog_object = tuple(sql_uncatalog_object) catalog.sql_uncatalog_object = tuple(sql_uncatalog_object)
# catalog.sql_update_object = tuple(sql_update_object)
catalog.sql_clear_catalog = tuple(sql_clear_catalog) catalog.sql_clear_catalog = tuple(sql_clear_catalog)
# uninstall objects # uninstall objects
ObjectTemplateItem.uninstall(self, context, **kw) ObjectTemplateItem.uninstall(self, context, **kw)
......
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