[Zope] Creating objects with python?

Christian Theune ct@gocept.com
Mon, 4 Feb 2002 13:26:05 +0100


On Mon, Feb 04, 2002 at 09:29:24AM +1100, Dean Grubb wrote:
> Hi,
>=20

Hi.

> Is it possible to create zope objects such as folders, database connectio=
ns,
> Z SQL Methods and documents with a script written in python? If so could
> someone provide a link to resources or provide some sample code. Thanks

Sure you can. Some hints are in the Zope Book, in the chapter about=20
python products.

In general you only need to find the appropriate class you want to=20
instanciate (I don't know one on the top of my head so i will do some
pseudo classes here) and handle it like every other class in python:

import myFineZopeClass

=2E..

    myZopeObject =3D myFineZopeClass.TheClass(parameters)=20

=2E..


and you got a ZopeObject. Look into the Zope Book how the factory
methods work.

>=20
> Dean
>=20

Christian

--=20
Christian Theune - ct@gocept.com
gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b'])