[ZCM] [ZC] 408/ 2 Reject "Property edits don't cause reindex"

Collector: Zope Bugs, Features, and Patches ... zope-coders@zope.org
Wed, 14 Aug 2002 11:02:44 -0400


Issue #408 Update (Reject) "Property edits don't cause reindex"
 Status Rejected, Catalog/bug medium
To followup, visit:
  http://collector.zope.org/Zope/408

==============================================================
= Reject - Entry #2 by Brian on Aug 14, 2002 11:02 am

 Status: Pending => Rejected

ZClasses are intended to give the building blocks to 
"do the right thing" (where you get to decide what the 
right thing is). Having the low-level property sheet code 
sniff for catalog awareness would actually cause problems 
for others who depend on the current behavior. It is also 
too low-level a place to put something like that.

I think that the workaround you implemented is a good one, 
and exactly in the spirit of what ZClasses are supposed to 
accomplish. They are really fairly limited in terms of 
"automating" things (the idea is that you build things 
with them that implement the automation).

-Brian
________________________________________
= Request - Entry #1 by Anonymous User on May 30, 2002 4:41 am

If a ZClass extends CatalogPathAware and CatalogAware, it will be added and removed to a Collection in the root called "Collection" successfully. However, when it is added, all of its properties will be blank, so it doesn't get indexed with anything useful.

When its properties are edited via the standard property editing sheets generated by Zope, it is not reindexed. As far as I can see, this makes automatic cataloguing nigh on useless, as edits to objects are not reflected until reindex_object() is called on them manually, and as such the index will never contain anything useful.

I'm working around this in my application by using custom create/edit forms that call reindex_object() at the appropriate point, but it does take away a lot of the ease of use of Zope, as I can no longer use Zope's management interface to quickly create an editing interface for objects that need to be automatically indexed.

Would it be possible to have the standard Zope property sheet editors check if the class is index aware, and if it is call reindex_object() when the property sheet is saved?
==============================================================