This should work:

<dtml-in substract>
  <dtml-if "_['sequence-item']!=''">
    update artikel_table set artikel_qty=artikel_qty - <dtml-sqlvar 
"_['sequence-item']" type=int>
      where artikel_id=<dtml-sqlvar "artikel_id[ _['sequence-index'] ]" type=string> 
    <dtml-var sql_delimiter>

              Jim Sanford
      .       Database Engineer
     / \  /   Accelerated Technology, Inc.
    /   /     720 Oak Circle Drive East
   /  /  \    Mobile, AL 36609
  / /     \   Voice: 334-661-5770  fax: 334-661-5788
 /         \  E-Mail: [EMAIL PROTECTED]
 Nucleus.  All You NEED in an RTOS.  Royalty Free

----- Original Message ----- 
From: Borno Janekovic <[EMAIL PROTECTED]>
Sent: Tuesday, August 08, 2000 11:13 AM
Subject: [Zope] Getting single values out of lists


I have a page wich is created out of a database. For every artikel (item)
I have a description and a number of available items.
The page has multiple rows (depending on the database content)
in every row is a input-box in wich the user can enter a number. This
number needs to be substracted from the available items number of the
correct artikel.

My question is how can I get the correct tuple of items out of the list.

For example

In every row I have the substract box and a hidden field with the primary
<input type="text" size=5 value="" name=substract>
<input type="hidden" value="<dtml-var artikel_id>" name="artikel_id">

When I submit the Form I get with the following lines 

<dtml-in "REQUEST.form.items()" sort>
   <dtml-var sequence-key>:<dtml-var sequence-item><br>

the content

substract = ['12', '', '', '', '', '', '', '', '', '']
artikel_id = ['20000808095658', '20000808095503', '20000808095341',
'20000808095744', '20000731135126', '20000808092056', '20000808092333',
'20000808092723', '20000808095232', '200007311227'] 

and this is correct. This means that a user has entered 12 for the
artikel_id 20000808095658.

How can I get the single values, so that I can use them? 

How can I extract the values from the list to use the tuple in a

Help would be great.



Sent through GMX FreeMail -

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to