Jim (or anyone else who's feeling charitable this morning),

Thanks for all your help. I really appreciate it. I wonder if you'd have
time to look one more time at the two methods I've got that aren't
working. I've included the actual code for my job posting product. Perhaps
someone will find it instructive. I have a feeling that the remaining
problem is not directly related to the processing of the form by the
PythonScript. I also included the traceback at the end of this message.

Here are the two methods. I have a table that displays the currently
available jobs and displays two little icons which call the edit or delete
methods on the corresponding instance of the 'Job Posting' class. The edit
icon links to the 'editJobForm' method which in turn calls the
'editFormAction' method that actually processing the change.


<dtml-var standard_html_header>

<h2>Edit a Job Board Entry</h2>
<p>This form allows you to make changes to current postings on the online
job board. You don't needed to fill in every 
field on the form. Click on the "Submit Edits" button at the bottom of the
screen to save your changes to the database.</p>

<dtml-if "REQUEST.form.has_key('editJob')">
<dtml-call "editFormAction(REQUEST)">
<p><font color="red">Your changes have been saved</font></p>

<form action="editJobForm">
<table border="0">

<td><textarea name="notes:text" rows="10" cols="60" wrap="virtual"><dtml-var
<tr><th>Job ID</th>
<td><input type="text" name="id" size="20" value="<dtml-var id>"></td>
<td><input type="text" name="organization" size="60" value="<dtml-var
<td><input type="text" name="position" size="60" value="<dtml-var
name="description:text" rows="10" cols="60" wrap="virtual"><dtml-var
<tr><th>Pay Offered</th>
<td><input type="text" name="pay" size="60" value="<dtml-var pay>"></td>
<tr><th>Line of Authority</th>
<td><input type="text" name="loa" size="60" value="<dtml-var loa>"></td>
name="function:text" rows="4" cols="60" wrap="virtual"><dtml-var
name="qualifications:text" rows="8" cols="60" wrap="virtual"><dtml-var
<td colspan=2>
<p>To create a bullet list of "duties," type each one in the box below and
press the "ENTER" key 
between each item in the list.</p>
<dtml-if duties>
<td><textarea name="duties:list" rows="10" cols="60" wrap="virtual"><dtml-in
duties><dtml-let item=sequence-item><dtml-if item>
<dtml-var item>
name="duties:list" rows="10" cols="60" wrap="virtual"></textarea></td>
<tr><th>Offer Expires</th>
<td><input type="text" name="expires" size="20" value="<dtml-var
offer_expires fmt="%m/%d/%Y">"></td>
<td colspan=2><p>Enter the date that the job was officially posted.</p></td>
<tr><th>Posted Date</th>
<td><input type="text" name="posted" size="20" value="<dtml-var date_posted
<input type="submit" name="editJob" value=" Submit Edits ">
<form action="admin_html">
<input type="submit" value=" Cancel ">

<dtml-var standard_html_footer>

editFormAction (with REQUEST as a parameter)


The error I get is:

 Error Type: TypeError
Error Value: sequence index must be integer


Traceback (innermost last):
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 222, in
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 187, in
  File /var/lib/zope/2.3.0a2/lib/python/Zope/__init__.py, line 221, in
    (Object: Traversable)
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 171, in
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/mapply.py, line 160, in
    (Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/ZPublisher/Publish.py, line 112, in
    (Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/OFS/DTMLMethod.py, line 189, in
    (Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_String.py, line
538, in __call__
    (Object: editJobForm)
  File /var/lib/zope/2.3.0a2/lib/python/DocumentTemplate/DT_Util.py, line
336, in eval
    (Object: editFormAction(REQUEST))
    (Info: REQUEST)
  File &lt;string&gt;, line 0, in ?
  File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line
325, in __call__
    (Object: editFormAction)
  File /var/lib/zope/2.3.0a2/lib/python/Shared/DC/Scripts/Bindings.py, line
354, in _bindAndExec
    (Object: editFormAction)
line 321, in _exec
    (Object: editFormAction)
    (Info: ({'script': &lt;PythonScript instance at 8826790&gt;,
'context': &lt;JobPosting instance at 871e068&gt;, 'container': &lt;Folder
instance at 885a3e0&gt;, 'traverse_subpath': []},

-- I've deleted what looks like the entire contents of REQUEST --

  File Python Script, line 2, in editFormAction
  File /var/lib/zope/2.3.0a2/lib/python/Products/PythonScripts/Guarded.py,
line 276, in __getitem__
  File /var/lib/zope/2.3.0a2/lib/python/OFS/PropertySheets.py, line 647, in
    (Object: Traversable)
TypeError: (see above)


Tim Wilson      | Visit Sibley online:         | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |                              | http://slashdot.org/
[EMAIL PROTECTED] |   <dtml-var pithy_quote>     | http://linux.com/

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to