[Zope-dev] Re: Catalog reindexing in Zope

Michel Pelletier michel@digicool.com
Tue, 11 Apr 2000 14:41:17 -0700


"R. David Murray" wrote:
> 
> Chris Crownheart wrote:
> >        I am trying to make a python based class be Catalog Aware and be
> >reindexed when it is edited.  I basically started with the Boring
> >Product How-To, and have turned it into a Company Product.  The class
> >inherits from CatalogAware (someone somewhere said that CatalogAware had
> >to be the first base class).  I create my Company instance in another
> >class by calling the constructor with no values, then immediately
> >calling the manage_edit method to update the data.  Based on that, I am
> >trying to index the object in the constructor, and reindex the object in
> >the manage_edit.  With the code below, the object gets indexed in the
> >catalog, but all the fields (indexes) are blank!  The reindex_object
> >call is not working for some reason.  (At least it is not updating the
> >field indexes like I would expect.)
> 
> (I moved this to zope-dev because I don't think it is a content-managers
> question...)
> 
> I'm having the same problem.  I call self.reindex_object() at the end
> of my edit method, but the catalog does not get updated.  If I
> call reindex_object by tacking it onto the end of the URL for my
> object, the catalog gets updated.  Is there a trick to getting
> reindex_object to work from a python product?  I'm using the
> default catalog name, by the way.
> 
> I'm running Zope 2.1.6, and I note that there was an exchange earlier
> about a possible problem in 2.1.6 where from a ZClass someone found
> they could not call reindex_object directly but had to use a redirect.
> Sounds like a variation on the same problem...anyone have a clue?

I suspect that the most recent changes in 2.1.5/6 to Acquisition have
broken this.  It's in the collector and it's on my list of things to do.

As a workaround, I suggest calling
RESPONSE.redirect('.../reindex_object').  This aparently works.

-Michel