[ZPT] How to translate <dtml-call MyMethod> little correction

Jeff Peterson jpeterso@rangebroadband.com
Wed, 23 Jan 2002 16:24:10 -0600


> Hi guys,
>
> thanks for the hints.
> Unfortunately it didn't work at first like you suggested.
> I had to change the script to following:
>
>  R = context.REQUEST
>
>  if R.form["submit"] == 'Insert':
>    context.InsertMethod(R)
>    print 'Your data was inserted!'
>  else:
>    print 'No Insert'
>
> return printed
>
>
> If I used R.form.submit I got the attached error message.
> Like it seems REQUEST.form is a dictionary and cannot be accessed like a
> object???

I'll buy that.  You can access it even more simply with:

if R.submit == 'Insert':

Form data is stored singularly in request as well.

Sorry for the errors, I did not test any of it.  I tried to be correct but
although the force is strong I have not developed into a true Zope Jedi as
of yet.  I rely a lot on error messages. ;)

I am glad you had little problem debugging it.

--
Jeffrey D. Peterson
Webmaster & Resident Standards Warrior
"The Trouble with doing anything right the first time is that nobody
appreciates how difficult it was."