Right now I only call index_object() after an edit, as I was assuming that
after adding things would be automatically taken care fo for me, but
obviously this is not the case.  There are, indeed, default values in some
properties within the class __init__ method.

I think what is happening is that I am indexing methods (not properties),
and since my factory method doesn't call an explicit reindex_object() after
some properties are changed (code below) I am having problems.  I wonder if
I call self[id].index_object() after self._setObject(id, ad) if that will do
the trick?

Thanks for the reply,

def manage_addAdItem(self, id, title, REQUEST=None):
 """Zope managment interface create method for AdItem"""

 if REQUEST is not None:
   if (len(REQUEST['keywords']) > 0):
   ad.setAdDateMulti(yyyy=REQUEST['Adyyyy'], mm=REQUEST['Admm'],
   ad.setRtDateMulti(yyyy=REQUEST['Rtyyyy'], mm=REQUEST['Rtmm'],
 self._setObject(id, ad)
 if REQUEST is not None:
   return self.manage_main(self, REQUEST)

-----Original Message-----
From: Toby Dickenson [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 6:28 AM
Subject: Re: [Zope-dev] Problems with CatalogAware?

On Fri, 31 Aug 2001 15:17:27 -0700, [EMAIL PROTECTED] wrote:

>I have a python product that has a class derived from CatalogAware and
>Folder.  I programmatically add instances of these (1000s of them) on an
>automated basis every day in the early morning.
>My problem is that whenever I do this, the Catalog is updated with some
>1 - Metadata is skewed: DateTime objects are cataloged, and they end up
>the wrong date ('2001/01/01') instead of today's date, even though the
>actual property contains today's date.  The index in question is built from
>a property.
>2 - Text indexes only get a portion of their text stored in the metadata,
>not all of it.  The index in question is built from a class method in the
>product code.

Appologies if you already know this.....

CatalogAware will automatically reindex if an object is added,
deleted, or moved. However it does not automatically reindex if
properties are changed.

It sounds like your index might contain the default (initial) values
for these properties. Do you need to add a call to reindex_object()
after changing them from the defaults?

Toby Dickenson

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to