[Zope] Creation of an ZClass Instance.

Kevin Dangoor kid@kendermedia.com
Wed, 8 Mar 2000 13:41:13 -0500


----- Original Message -----
From: "M.J. Stahl" <mjstahl@bizux.net>
To: <zope@zope.org>
Sent: Wednesday, March 08, 2000 1:07 PM
Subject: Re: [Zope] Creation of an ZClass Instance.


> ><input type=hidden name=id value="<dtml-var "REQUEST['id']">">
> >
> >Variables within REQUEST only exist for that particular web request. To
pass
> >values on to your _add method you need to put them in form fields or
> >cookies.
> >
> >Kevin
>
> Ok that seems to work because I am getting other errors and I think this
> task is a little advance for a zope infant like myself. Now, this line is
> causing me problems (this happened after I called entered the hidden
field):
>
> <dtml-call "REQUEST.set('id',_.str(_.int(id)))">
>
> The error it gave me was:
>
> Error Type: ValueError
> Error Value: invalid literal for int(): generator
>
> It seems to be refering to the "(.int(id)))" of the above code.

Yes, that makes sense. When it looks up "id" in the namespace, it first
comes across the id of your method. You're specifically wanting the "id"
from the REQUEST variable. So, the line should be:

<dtml-call "REQUEST.set('id',_.str(_.int(REQUEST['id'])))">

Kevin