[Zope] Delete the properties and propertysheet defined by ZClass

Takakazu Tamaki kaz at oceanbreeze.co.jp
Mon Sep 20 13:57:17 EDT 2004


Hi, Dieter

According to the docs in the /OFS/PropertySheets.py and
/ZCasses/Property.py, you gave me the right answer. :)

Thanx.

On Mon, 20 Sep 2004 19:16:26 +0200
Dieter Maurer <dieter at handshake.de> wrote:

> The property definitions (names, types, default values) live
> in the property sheet; instance specific property values
> live as attributes on the respective instance.
> 
> This means, you must make a script that visits your instances
> and deletes all attributes that correspond to a deleted property.
> Something like:
> 
> 	  for pn in yourSheet.propertyIds():
> 	    try: delattr(obj, pn)
> 	    except AttributeError: pass
> 
> After that you can delete the property sheets themthelves.
> 

---
kaz



More information about the Zope mailing list