[Zope-CMF] Product properties: set and get ?

Chris Withers chrisw@nipltd.com
Mon, 12 May 2003 16:00:19 +0100


D2 wrote:
> I tried this :
> 
> def add_ClassProperty(product, klass, property, value):
>     """Change a class properties
>        The class must have PropertyManager in its hierarchy
>     """
>     exec 'from %s import %s' % (product, klass)
>     exec 'setattr(%s, property, value)' % (klass)
>     exec '%s._properties=%s._properties+({\'id\':property, 
> \'type\':\'string\'},)' % (klass, klass)
> 
> 
> add_ClassProperty('OFS.Folder', \
>                   'Folder', 'New_property', 'New Value')

Aaagggh! What ARE you doing?

More to the point, why are you doing it?

And, more usefully, what are you actually trying to achieve here?

cheers,

Chris