[Zope] Product that publishes python classes
Dieter Maurer
dieter@handshake.de
Thu, 15 Mar 2001 22:07:15 +0100 (CET)
Jan writes:
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_00EF_01C0AD69.D01FF320
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
Please do not post MIME messages!
> When added into zope tree, takes a python class as a parameter and =
> publishes all it's methods into zope:
>
> a) as a properties of itself.
> b) acts as a folder and contains the methods in itself.
>
> Does anyone have any good ideas how to make such a product?
You do not publish the methods of classes but of objects
(or class instances).
Thus, your product must instantiatiate the class
and either
* place the instance as Zope object in the site hierarchy
(there are some restrictions to observe,
the class should be an instance of "Persistent"
and "Acquisition.Implicit" (or "Explicit").
* use the "__bobo_traverse__" hook to make
the object URL accessible.
Some of what you need to learn is in the Product Development Guide
(--> zope.org). Other things, you may find in
URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html
Dieter