[Zope-CMF] Dumb ZClass question

Tres Seaver tseaver@zope.com
Mon, 03 Sep 2001 16:27:22 -0400


Jon Edwards wrote:

> I followed the "Building FAQ with Zclasses" tutorial, but changed it a bit
> :-)
> 
> I just wanted Documents with a few extra properties - such as "org_id", to
> show which organisation an object belongs to. All went well, but I can't
> figure out how to get the "org_id" property to be automatically Cataloged. I
> added "org_id" to a propertysheet, and it adds and displays OK when I create
> objects.
> 
> I used CMFDefault:Document as a baseclass on its own, and with PortalContent
> and CatalogAware as well ...


You shouldn't need either of the last two -- it gets PortalContent
transitively from Document, and CatalogAware is redundant.

> and I added "org_id" as both a FieldIndex and as
> Metadata in the PortalCatalog.
> 
> But when I add my new objects, "org_id" isn't getting cataloged :-(
> 
> I'm sure there's a simple answer I'm missing, and I've RTFM'd lots, but
> can't find it. Can anyone help?


Probably you need to add a call to 'context.reindexObject()' in the
PythonScript which processes your form POST, after the call to
'context.propertysheets.whatever.manageChangeProperties( org_id=org_id )'.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com