reindex_object() in a python script??
Hi, I create an Object instance in a python script, and then change two of the properties. (see below). Even though i'm calling reindex_object, after the Task object is added to the Folder, it is not in the ZCatalog TaskCatalog until i manually add it. The Task's ZClass (task) is CatalogAware. Thoughts? Thanks, mark folder2 = getattr(context, 'Tasks') id = context.ZopeTime().strftime('%Y%m%d%H%M%S') theProject=folder2.manage_addProduct['Task'].task.createInObjectManager(id, context.REQUEST) theProject.propertysheets.primary.manage_changeProperties(task_desc=REQUEST. input_desc) theProject.propertysheets.primary.manage_changeProperties(task_name=REQUEST. input_name) theProject.propertysheets.primary.manage_changeProperties(project_id=REQUEST .input_project_id) theProject.reindex_object()
Mark A. Lilly writes:
I create an Object instance in a python script, and then change two of the properties. (see below). Even though i'm calling reindex_object, after the Task object is added to the Folder, it is not in the ZCatalog TaskCatalog until i manually add it. The Task's ZClass (task) is CatalogAware.
A catalog aware instance needs to find the catalog to index in. It uses a fixed name, default "Catalog", to get it via acquisition. You need to change the catalog name, in order to index in a different catalog. There is a method to change this catalog id. However, I do not know its name (without looking, which you can do yourself). Dieter
participants (2)
-
Dieter Maurer -
Mark A. Lilly