Commit bc35cfb6 authored by Ayush Tiwari's avatar Ayush Tiwari

erp5_catalog: Rename reindexObject method to use them as new methods for CatalogTool.

- This step is needed due to the use of BaseTool as Base class for CatalogTool
  due to which there were conflict between reindexObject from the Base and the one
  from the BaseTool.
parent 51c11c8c
...@@ -827,6 +827,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -827,6 +827,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
if idxs is None: idxs = [] if idxs is None: idxs = []
url = self.__url(object) url = self.__url(object)
self.catalog_object(object, url, idxs=idxs, sql_catalog_id=sql_catalog_id,**kw) self.catalog_object(object, url, idxs=idxs, sql_catalog_id=sql_catalog_id,**kw)
# Required for compatibilty with ERP5CatalogTool
reindexCatalogObject = reindexObject
def catalogObjectList(self, object_list, *args, **kw): def catalogObjectList(self, object_list, *args, **kw):
......
...@@ -18,7 +18,7 @@ from Products.CMFCore.CMFCatalogAware import CMFCatalogAware ...@@ -18,7 +18,7 @@ from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from Acquisition import aq_base from Acquisition import aq_base
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
def reindexObject(self, idxs=[], *args, **kw): def reindexCatalogObject(self, idxs=[], *args, **kw):
""" """
Reindex the object in the portal catalog. Reindex the object in the portal catalog.
If idxs is present, only those indexes are reindexed. If idxs is present, only those indexes are reindexed.
...@@ -32,7 +32,7 @@ def reindexObject(self, idxs=[], *args, **kw): ...@@ -32,7 +32,7 @@ def reindexObject(self, idxs=[], *args, **kw):
if getattr(aq_base(self), 'notifyModified', None) is not None: if getattr(aq_base(self), 'notifyModified', None) is not None:
self.notifyModified() self.notifyModified()
catalog = getToolByName(self, 'portal_catalog', None) catalog = getToolByName(self, 'portal_catalog', None)
if catalog is not None: if catalog is not None :
catalog.reindexObject(self, idxs=idxs, *args, **kw) catalog.reindexCatalogObject(self, idxs=idxs, *args, **kw)
CMFCatalogAware.reindexObject = reindexObject CMFCatalogAware.reindexObject = reindexCatalogObject
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