[Zope] exposing properties to python
Dieter Maurer
dieter@handshake.de
Tue, 10 Jul 2001 20:11:28 +0200 (CEST)
Joe Little writes:
> In my particular case, I need to expose properties (either in property
> sheets or product-properties ($64K question is what is better to use!))
> via python scripts either when I instantiate a ZClass based on the
> python base-class or in a post instantiation method in that base-class.
> I can't find any good python examples throughout the zope.org site.
> almost everything is either zclass-built and thus using property sheets
> via DTML
You do it as in DTML:
Properties are exposed as attributes. Thus, if "o" is an object
and "p" one of its attributes, you use "o.p".
For modification (and access) you can use the
"PropertyManager/PropertySheet" API (Online Help -> ZopeHelp -> API Reference).
Dieter