[Zope] unsliceable object error

JP Sieck jp@bluevera.com
Sat, 8 Feb 2003 19:21:54 -0500


I'm getting an unsliceable object error when I attempt to insert a new
record due to my Instructors:list.  Take a look and let me know what I am
doing wrong and if there is a better way to do this (pardon the roughness of
the code).

I am using:

Zope Version 2.6.0 (binary release, python 2.1, win32-x86), python 2.1.3,
win32)
Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)]
System Platform = win32
Database = Access 2000 (client required Access)

The ZSQL insert method and DTML code which creates the list are shown below:

ZSQL Method
----------------------------------------------------------------------------
---------------------
ARGUMENTS:
Instructors:list:int=""

SQL:
<dtml-with expr="SEL_LastSessionInserted()[0]">
    <dtml-if SessionId>
        <dtml-comment>delete instructors who are associated with this
session</dtml-comment>
        DELETE * FROM SessionInstructors WHERE SessionId=<dtml-sqlvar
SessionId type=int> + 1

        <dtml-comment>insert instructors who are associated with this
session</dtml-comment>
        <dtml-in Instructors>
           <dtml-var sql_delimiter>
           INSERT INTO SessionInstructors (SessionId, InstructorId)
           VALUES
           (
             <dtml-sqlvar SessionId type=int> + 1,
             <dtml-var "_['sequence-item']">
            )
         </dtml-in>
     </dtml-if SessionId>
</dtml-with>


The DTML code which creates the lists:
----------------------------------------------------------------------------
------------------------------------------
<dtml-var hf_html_header>

<h2 class=h2><dtml-var title_or_id >
<p>
  <FORM ACTION="test_results" method="POST" name="asf">
    <select name="Instructors:list" size="10" multiple>
      <dtml-in "Instructors.SEL_InstructorsBrowseMethod()">
         <option value="<dtml-var Id>"><dtml-var FirstName></option>
      </dtml-in>
    </select>
    <input type=submit value=submit>
  </FORM>
</p>
<dtml-var hf_html_footer>