Steve Alexander wrote:
>
> Michael Bernstein wrote:
> >
> > 'BookProduct' product
> > *'BookClass' ZClass (inherits from
> > _ZClass_for_CatalogAware, _ZClass_for_DataSkin)
>
> Don't derive from CatalogAware when you're also deriving from DataSkin.
Ok.
> Rather than use the CatalogAwareness mechanism to
> manually call reindex() when your object changes, you
> should use some SkinScript in your Specialist or in your
> Customizer to catalog, uncatalog and recatalog on changes.
>
> WHEN OBJECT ADDED CALL
> Catalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/'))
> WHEN OBJECT DELETED CALL
>Catalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/'))
> WHEN OBJECT CHANGED CALL
>Catalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/')),
> Catalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/'))
Thanks, Steve. I'll try this a little later today. What are
your thoughts on placing this in the Specialist's 'Plug-ins'
tab vs. the Rack's?
> [snip]
> > Also, I would like to replace the three indexes I'm
> > maintaining on the books with a single text index on a
> > computed attribute. I understand that this involves adding a
> > SkinScript to the Rack containing something like 'WITH SELF
> > COMPUTE AllText=AllTextMethod', but I'm unsure of the
> > details. I have a method (AllTextMethod) on the ZClass that
> > returns several fields concatenated as a single string,
> > which I would like to use as a text index.
>
> You don't need a method for this; do it all with SkinScript like this:
>
> WITH SELF COMPUTE
> all_text='%s %s %s' % (title, headline, content)
Thanks again, Steve.
Cheers,
Michael Bernstein.
_______________________________________________
Zope-Dev maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )