Hello, I am developing all my logic in python classes and using Zope for the presentation so that I can use CLI and other toolsets against the same objects. 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 I'm not on the list, so any answers, please send to me directly if not to the list as well. Also, if I shouldn't use product properties or product-instance property sheets, what should I use to communicate to python scripts from an add_form constructor or the like? I am used to python programming, but the Zope<->Python bridge hasn't made any sense to me thus far.
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
participants (2)
-
Dieter Maurer -
Joe Little