[Zope] File management using Zope's API
Dieter Maurer
dieter@handshake.de
Wed, 25 Jul 2001 21:42:22 +0200 (CEST)
Nicolas Villetard writes:
> I'd like to manage (create, modify, ...) Zope File objects using Zope
> API in Python External Methods.
>
> The only thing I have found is the API reference but unfortunately I
> still don't know anything about how to use Zope API...
It is incredibly simple:
A Zope object is an instance of some class.
A class implements a set of interfaces.
An interface is a set of attributes, i.e. members and methods.
These interfaces are described in the API.
How to use it:
if you have an object "o" from class "c" implementing
interface "i" defining method "m", then you use
o.m(... parameters as defined by "i" ...)
The interface also speaks of constructors. They are
used to construct (= create) objects.
They are methods of so called product factories.
You use them as follows:
container.manage_addProduct[...product_name...].constructor(
... parameters as defined by "i" ...)
to add an object to "container".
You find more information in the "OO preliminaries" section of
URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html
Dieter