[Zope] Return of Zoo guestbook problem.

Ignacio Valdes ivaldes@hal-pc.org
Mon, 09 Apr 2001 11:56:43 -0500


Thanks Sandy,  Deleted the """ comments, same result:

             Zope Error

             Zope has encountered an error while publishing this resource.

             Error Type: NameError
             Error Value: context



             Troubleshooting Suggestions

                  This resource may be trying to reference a nonexistent
object or variable context.
                  The URL may be incorrect.
                  The parameters passed to this resource may be incorrect.
                  A resource that this resource relies on may be
encountering an error.

             For more detailed information about the error, please refer to
the HTML source for this page.

             If the error persists please contact the site maintainer. Thank
you for your patience.


Traceback (innermost last):
  File /home/zope/zope5/lib/python/ZPublisher/Publish.py, line 223, in
publish_module
  File /home/zope/zope5/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /home/zope/zope5/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File /home/zope/zope5/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /home/zope/zope5/lib/python/ZPublisher/mapply.py, line 160, in mapply

    (Object: addEntryAction)
  File /home/zope/zope5/lib/python/ZPublisher/Publish.py, line 112, in
call_object
    (Object: addEntryAction)
  File /home/zope/zope5/lib/python/OFS/DTMLMethod.py, line 189, in __call__
    (Object: addEntryAction)
  File /home/zope/zope5/lib/python/DocumentTemplate/DT_String.py, line 538,
in __call__
    (Object: addEntryAction)
  File /home/zope/zope5/lib/python/DocumentTemplate/DT_Util.py, line 334, in
eval
    (Object: addEntry(guest_name, comments))
    (Info: guest_name)
  File <string>, line 0, in ?
  File /home/zope/zope5/lib/python/Products/PythonMethod/PythonMethod.py,
line 168, in __call__
    (Object: addEntry)
    (Info: (('Anonymous', 'test'), {}, None))
  File <string>, line 3, in addEntry
NameError: (see above)

Sandy Britain wrote:

> Hi Ignacio,
>
> replace the quotation mark comments ["""] surrounding line 1: 'Create a
> guest book entry' with a simple hash [#] comment preceding it..
>
> .....or just delete the whole comment!   It is those quotation marks the
> compiler doesn't like
>
> cheers Sandy
>
> Ignacio Valdes wrote:
>
> > Hello all,
> >
> > I'm trying to tackle the Zoo GuestBook example from the Zope book:
> > http://www.zope.org/Members/michel/ZB/SimpleExamples.dtml
> >
> > I've got it all working except the last part in the AddEntry python
> > script. I now have Zope 2.3.1 installed on my ISP's system. The script
> > craters on the first line which reads:
> >
> >       """
> >       Create a guest book entry.
> >       """
> >       # create a unique document id
> >       id='entry_%d' % len(context.objectIds())
> >