[Zope-dev] Anyone know how to add a property to a Zope Product (not its instances)?

Joachim Werner joe@iuveno-net.de
Sat, 20 Oct 2001 23:41:36 +0200


> By default, Zope adds the title and version properties, for which it
> gets the value from version.txt and meta_type,
> but does anyone know a way to add more?

This is only half an answer, but maybe it helps:

I am not quite sure if you can do that the easy way from Python. (I.e. just
define a _properties list). But you certainly can use manage_addProperty:

self.Control_Panel.Products.YOURPRODUCT.manage_addProperty(id="TEST",
value="TEST ENTRY", type="string")

The question is where to put this, probably somewhere in the __init__.py? I
don't know if you CAN call it from there. It definitely works from the
contructor method of your product, but then the new property will only show
up after the first instance has been added ...

Joachim