Ok.  I get a list of rows from a database query.  I want
to iterate over the rows.  If there are 3 or more
columns in the table, everythin is fine.  If there are 2 
columns, it doesn't work.

It seems as if dtml-in handles lists of pairs specially. 
Not a good thing.  Can I supress this behavior?

Here is an example of this:

-------------------

<h4>Iterate over 3.tuples</h4>
<dtml-let list="[('a','b','c'),('d','e','f')]">
   <dtml-in list>
      <dtml-var sequence-item><br>
      <dtml-in sequence-item>
         > <dtml-var sequence-item></br>
      </dtml-in>                
   </dtml-in>
</dtml-let>
<h4>Iterate Over 2-tuples</h4>
<dtml-let list="[('a','b'),('c','d')]">
   <dtml-in list>
      <dtml-var sequence-item><br>
      <dtml-try>
      <dtml-in sequence-item>
         > <dtml-var sequence-item></br>
      </dtml-in>
      <dtml-except>
        <h4>Why can't I do this!</h4>
      </dtml-try>       
   </dtml-in>
</dtml-let>
<h4>Iterate Over 1-tuples</h4>
<dtml-let list="[('a',),('b',)]">
   <dtml-in list>
      <dtml-var sequence-item><br>
      <dtml-in sequence-item>
         > <dtml-var sequence-item></br>
      </dtml-in>                
   </dtml-in>
</dtml-let>

-----------------------

-- cary

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

Reply via email to