[Zope] ZPublisher guestbook.py

Amos Latteier amos@aracnet.com
Mon, 15 Feb 1999 12:55:49 -0800


At 06:21 PM 2/15/99 -0300, Luciano Ramalho wrote:
>I got stuck implementing the examples in "A Technical Introduction to
>Object Publishing with Zope"
><http://www.zope.org/Documentation/Reference/ObjectPublishingIntro> with
>the stand-alone ZPublisher.
>
>In the "guestbook.py" example, what should be the URL invoked to show the
>form? The module is called guestbook.py, the class is GuestBook and the
>method is defined as "def guestbookForm(self)". 
>
>I've been succesful installing and runnig the previous examples but in this
>case I don't know what should be the first URL called to run the Guestobook
>application.

The trick is to realize the ZPublisher publishes *instances*, not classes.
It is not enough to define a class, you must create an instance of that
class, and call the instance.

Notice the last two lines of guestbook.py

# Create an instance of a GuestBook
myGuestBook=GuestBook('My GuestBook', 'guestbookdata.txt')

This is the guestbook instance that you want to publish.

So your URL will look something like this:

http://localhost/cgi-bin/GuestBook.zcgi/myGuestBook

Make sense?

-Amos