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.
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
WHEN OBJECT DELETED CALL
WHEN OBJECT CHANGED CALL
> I'm also not sure it's
> a good or bad idea to place the ZCatalog directly into the
That's a good idea. The catalog is what the specialist uses to
answer questions from other parts of your application such as
"what instances have baz for the foo property".
So, it should live inside the Specialist, and you should
provide a set of methods in the Specialist that answer
the questions the rest of you application need answered.
> 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)
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -