[Zope] Re: [Zope-dev] Adding Properties to Folder Objects via a Zope Python Script

Leonardo Rochael Almeida leo@hiper.com.br
31 Jan 2003 10:58:04 -0200


On Thu, 2003-01-30 at 19:52, Asad Habib wrote:
> Hi. I was wondering whether any of you know if it is
> possible to create properties for Folder objects using
> a Zope Python script that can then be invoked from a
> DTML method. I know that this is possible using Zope's
> management interface, but this procedure is not
> scalable. Any input would be appreciated. Thanks.

In your PythonScript, call 

theFolder.manage_addProperty(id=<property-id>, value=<property-value>, type=<property-type>)

later on, when you need to change a property, you can call:

theFolder.manage_changeProperties(<property-id>=<property-value>)

For more information on managing properties, read the file

<your zope>/lib/python/OFS/PropertyManager.py


Cheers, Leo

-- 
Ideas don't stay in some minds very long because they don't like
solitary confinement.