Thanks very much Jim, it worked.! ______________ La información contenida en este correo electrónico es legalmente privada y confidencial. Cualquier uso, modificación, difusión y/o reproducción de cualquier persona distinta del destinatario está prohibida. Si Vd. recibe este mensaje por error, por favor bórrelo y comuníquelo al remitente. -----Original Message----- From: Jim Washington [mailto:jwashin@vt.edu] Sent: viernes, 08 de marzo de 2002 10:45 To: Ariel Rivera Merla Cc: 'zope@zope.org' Subject: Re: [Zope] Hello All, Newbee here neds little help. Thanks Ariel Rivera Merla wrote:
Hi, im a newbee with ZOPE and with this mailing list trying to do the GUEST BOOK example thats on this page: http://www.zope.org/Members/michel/ZB/SimpleExamples.dtml
At the end of the example theres a pytho script thats needed to finally make the GuestBook example work, so when i copy it from the page, and paste it on zope (creating a python script) , sope says that thescript has errors.... Im not familiar with python, so if anyone could help, ill apreciate it. Thanks
Heres the python script copied from the page above:
## Script (Python) "addEntry" ##parameters=guest_name, comments ## """ 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')
Python is funny about indentation. Remove the leading spaces from each line, and it should work. For future reference, anytime a statement ends in a colon (:) you will need to assure indenting the succeeding statement block uniformly. Welcome to Python! -- Jim Washington