[Zope-CMF] Additional property to portal_type

Tres Seaver tseaver@zope.com
02 Aug 2002 13:50:39 -0400


On Thu, 2002-08-01 at 19:44, Pawel Lewicki wrote:

> Is there any simpler way to add an extra property to default CMFDocument
> (e.g.) than overriding the whole class?

ScriptableTypeInfo is your friend:

http://cmf.zope.org/Members/tseaver/how_tos/using_scriptable_type_info

You can add properties after creating the object using
'manage_addProperty', e.g.::

  product.manage_addProperty( 'some_prop', 'initial value', 'string' )

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com