[Zope] Zoo guestbook example.

Ignacio Valdes ivaldes@hal-pc.org
Tue, 06 Feb 2001 23:09:25 -0600


Hello all,

I'm working the Zoo guestbook example:

http://www.zope.org/Members/michel/ZB/SimpleExamples.html

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:

      """
      Create a guest book entry.
      """
      # create a unique document id
      id='entry_%d' % len(context.objectIds())

      # create the document
      context.manage_addProduct['OFSP'].manage_addDTMLDocument(id,
                                               title="", file=comments)

      # add a guest_name string property
      doc=getattr(context, id)
      doc.manage_addProperty('guest_name', guest_name, 'string')

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?

-- IV