[Zope] Zoo guestbook example.

Markus Kemmerling markus.kemmerling@mediaweb.at
Wed, 7 Feb 2001 11:36:58 +0100


The examples in the ZB are suppossed to work with Zope 2.3 only. =
Probably you are using an older version. I got the examples running by =
replacing 'context' with 'self' (and maybe some other minor changes, =
that I cant't remember).

Good luck!

Markus Kemmerling

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Ignacio Valdes
> Sent: Wednesday, February 07, 2001 6:09 AM
> To: zope@zope.org
> Subject: [Zope] Zoo guestbook example.
>=20
>=20
> Hello all,
>=20
> I'm working the Zoo guestbook example:
>=20
> http://www.zope.org/Members/michel/ZB/SimpleExamples.html
>=20
> and have created all the documents which seem to work fine. The Python
> method addEntry that drives the actual update of the database I =
created
> by doing an add python script then putting the code in just like the
> example as follows:
>=20
>       """
>       Create a guest book entry.
>       """
>       # create a unique document id
>       id=3D'entry_%d' % len(context.objectIds())
>=20
>       # create the document
>       context.manage_addProduct['OFSP'].manage_addDTMLDocument(id,
>                                                title=3D"", =
file=3Dcomments)
>=20
>       # add a guest_name string property
>       doc=3Dgetattr(context, id)
>       doc.manage_addProperty('guest_name', guest_name, 'string')
>=20
> Syntactically it looks good to Zope, but it has a problem with the
> 'context' variable and doesn't seem to know what it is. Any idea what =
I
> might be doing wrong?
>=20
> -- IV
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20