[Zope-dev] problem with catalog awareness
Leonardo Rochael Almeida
leo@hiper.com.br
Thu, 13 Sep 2001 20:35:39 -0300
If you are using ZClasses with default constructors, this is most likely due
to a Product factory method updating a ZClass instance *after* adding it to
a folder. CatalogAware will index the instance in the ZCatalog before it
gets its fields updated in the constructor, which means that what you get
cataloged is a mostly empty object (where 'empty' means 'with default
values'). You should call reindex_object() on the ZClass instance after
changing it in the constructor, and also everytime you change it.
This happens because CatalogAware doesn't track changes to objects. It only
tracks removal, insertion and renaming (I think) which means that when you
cut/copy and then paste the object, the pasted object works as you expected.
Cheers, Leo.
On Thu, Sep 13, 2001 at 12:56:25PM +0000, Lukas Maag wrote:
> hi all,
>
> i made a catalog aware class and want to use it with a catalog. i'm running
> zope 2.1.4 on a nt server (sp5).
> when i add the catalog aware object, it is automatically listed in the catalogs
> 'catalog' tab, but the indexes are not automatically
> updated (when i want to search them with a search interface, they do not exist).
>
> strange thing: when i copy the object in the manage enviroment, an paste it
> afterwards at same place, everything work fine!
>
> can someone help me!
> thanx