> William Joye wrote:
> 
> > Hello,
> > 
> > I'm a newbie in zope. I think is a simple problem but I can find a solution.
> > I would like to show 2 lists (ex: list1 and list2) like this :
> > 
> > list1 = 1, 2, 3,...
> > list2 = A, B, C,...
> > 
> > list1 + list2 =
> > 
> > 1 A
> > 2 B
> > 3 C
> > 
> > How can I iterate 2 lits in one dtml-in ?

Kapil wrote:
>
> for me the easiest way seems to combine the two lists and iterate over
> the results in a dtml in. problem is that doing this in dtml is hard
> cause of safety restrictions, in python its pretty slack though. here is
> a web python method that does the list work.
>
> name: combine
> args l1, l2
> return map( (lambda x,y:(x,y)), l1, l2)
>
> and the dtml
>
> <dtml-in "combine(list1, list2)">
> <dtml-var sequence-key> - <dtml-var sequence-item>
> </dtml-in>

You can also do this:

<dtml-in list1>
  <dtml-var sequence-item> - <dtml-var "list2[_['sequence-number']-1]">
<br>
</dtml-in>


--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

_______________________________________________
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