[Zope] Use only part of a list sequence? or External Method to Insert ZSQL?

Joseph A. Archer archerja@jmu.edu
Thu, 9 Mar 2000 19:03:38 -0500


To all Zopists,

<background>
I have a form that has several dynamically generated options from a MySQL
database.  I have each option using a hard-coded array like
name="mylist[0]", name="mylist[1]", etc..., and keep the value blank unless
selection is made.  Everything is working fine.  In the next page, I will
insert the Authenticated_user as the userid, and another field into a table
in the MySQL database.  When I get to the next page, I have:
...
<dtml-in mylist>
    <dtml-if "_['sequence-item'] != ''">
      <dtml-if "countuser(`AUTHENTICATED_USER`) < 6">  ##countuser counts
user in table
                 will be inserted into tabel here...
      </dtml-if>
    </dtml-if>
</dtml-in>
...
People are only allowed to have 5 entries in the table.
</background>

Here are my questions:
1.  Should I use an External Method that accesses a ZSQL Method to insert
the fields into the table?
(please give me an example of this, it sounds interesting...)

2.  Is there a way to only use the first 5 listings of the sequence?  Maybe
save into another list, then go directly to a ZSQL method insert?

3.  Should I just quit and go home?
:o)

Any help would be greatly appreciated.

virtually,

Joseph A. Archer
IT Coordinator
Facilities Management
James Madison University
archerja@jmu.edu