[Zope-dev] Re: Catalog reindexing in Zope

Chris Crownhart ccro@ifopen.com
Tue, 18 Apr 2000 09:10:20 -0600


Thanks for the note.  I'll give it a try.  Did you mean to have 3 dots
in there or just two, though?

Also,  I am curious if anyone knows how to index an object into multiple
ZCatalogs.  

I have code like the following in my  Python constructor, but my object
only gets indexed in the second catalog:
      self.default_catalog='AACatalog'
      self.index_object()
      self.default_catalog='ZZCatalog'
      self.index_object()

Any ideas?

Thanks,

	Chris

Michel Pelletier wrote:
> 
> "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