[Zope] Delete the properties and propertysheet defined by ZClass

Dieter Maurer dieter at handshake.de
Mon Sep 20 13:16:26 EDT 2004


Takakazu Tamaki wrote at 2004-9-20 21:05 +0900:
>On my migration of Zope system, the one of ZClass common propertysheets
>has stopped using. So, first I just simply delete the definition of this
>propertysheet on ZClass, but namespace of existing ZClass instances seem
>to be polluted by old properties which were defined by that
>propertysheet. 

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.

-- 
Dieter


More information about the Zope mailing list