[Zope-Coders] Re: [ZC] 408/ 2 Reject "Property edits don't cause reindex"

Martin Maisey martin@maisey.co.uk
Mon, 19 Aug 2002 06:43:00 UT


Thanks for the update. I may add a comment to the online manual to
describe some of this as I had to hunt quite extensively to find out
how to do this.

Cheers,

Martin

On Wed, 14 Aug 2002 11:02:44 -0400, "Collector: Zope Bugs, Features,
and Patches ..." <zope-coders@zope.org> said:
> Issue #408 Update (Reject) "Property edits don't cause reindex"
>  Status Rejected, Catalog/bug medium
> To followup, visit:
>   http://collector.zope.org/Zope/408
>=20
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> =3D Reject - Entry #2 by Brian on Aug 14, 2002 11:02 am
>=20
>  Status: Pending =3D> Rejected
>=20
> ZClasses are intended to give the building blocks to=20
> "do the right thing" (where you get to decide what the=20
> right thing is). Having the low-level property sheet code=20
> sniff for catalog awareness would actually cause problems=20
> for others who depend on the current behavior. It is also=20
> too low-level a place to put something like that.
>=20
> I think that the workaround you implemented is a good one,=20
> and exactly in the spirit of what ZClasses are supposed to=20
> accomplish. They are really fairly limited in terms of=20
> "automating" things (the idea is that you build things=20
> with them that implement the automation).
>=20
> -Brian
> ________________________________________
> =3D Request - Entry #1 by Anonymous User on May 30, 2002 4:41 am
>=20
> 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.
>=20
> 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.
>=20
> 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.
>=20
> 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?
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
>=20

--=20
martin@maisey.co.uk