[Zope] ZClasses meet PythonScripts, sample request

Jim Washington jwashin@vt.edu
Mon, 15 Jan 2001 08:13:19 -0500


Hi, Tim

You do not need to mess with the Python Script bindings.  It looks like
you are trying to get URL:

www.isd197.k12.mn.us/hr/jobs/postings/1234/editJobAction(REQUEST)

Which of course does not exist.  I would change your <form action="..
line to 

<form action="editJobAction" method="post">

assuming the DTML Method that has the form is called editJobAction. 
Don't worry about passing REQUEST there; Zope takes care of that.

-- Jim Washington

Timothy Wilson wrote:
> 
> This seems to almost work. :-)
> 
> On Sun, 14 Jan 2001, Jim Washington wrote:
> 
> > !<dtml-var standard_html_header>
> >
> > !<dtml-if "REQUEST.form.has_key('editCD')">
> > !  <dtml-call "manage_changeCDProperties(REQUEST)">
> > !  <p><font color="red">Your changes have been saved</font></p>
> > !</dtml-if>
> >
> > !<form action="replace_this_with_id_of_this_method">
> >  <table border="0">
> >
> >  <tr><th>Title</th>
> >   <td><input type="text" name="title" value="<dtml-var title>"></td>
> >  </tr>
> >
> >  <tr><th>Artist</th>
> >    <td><input type="text" name="artist" value="<dtml-var artist>"></td>
> >  </tr>
> >
> >  <tr><td>
> > ! <input type="submit" name="editCD" value=" Submit Edits ">
> >  </td></tr>
> >  </table>
> >  </form>
> > !<dtml-var standard_html_footer>
> 
> That's quite clever. I wouldn't have thought of doing it that way.
> 
> After translating the CD example to my own ZClass, I get the following error
> after hitting "Submit Edits" on the edit form:
> 
> <h2>Zope Error</h2>
> <p>Zope has encountered an error while publishing this resource.
>   </p>
> <p><strong>Resource not found</strong></p>
> Sorry, the requested Zope resource does not exist.<p>Check the URL and try
> again.<p>
> <!--
> http://www.isd197.k12.mn.us/hr/jobs/postings/1234/editJobAction%28REQUEST%29
> -->
> 
> and the traceback:
> 
> Traceback (innermost last):
>   File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 222, in
> publish_module
>   File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 187, in
> publish
>   File /var/lib/zope/2.3.0a2/lib/python/Zope/__init__.py, line 221, in
> zpublisher_exception_hook
>     (Object: Traversable)
>   File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 162, in
> publish
>   File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/BaseRequest.py, line 369,
> in traverse
>   File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/HTTPResponse.py, line
> 528, in notFoundError
> NotFound: (see above)
> 
> It looks like REQUEST isn't getting passed correctly. I've got REQUEST
> listed as a parameter for my PythonScript. I don't need to mess with
> bindings do I?