[Zope] first-variables in a simple loop on a list

Smith, Neil (Worcester) Neil.Smith at npower.com
Wed Sep 24 11:42:21 EDT 2003


I have a dtml-in loop over a simple list like:

<dtml-set mylist="[1,2,3,4]">
<dtml-in mylist>
  <dtml-var sequence-item>
</dtml-in>

It's actually within a Z-SQL method, and the list is returned from a form
but I don't want to over complicate the example.

Now I really only want the unique values from the list.  I figured the best
way would be to sort the list then use the first- grouping variables.

I can do this just fine if the dtml-in is on something returning named
variables, but my problem is that I can't figure out first-what when it's
just looping on a simple list.  I've tried first-sequence-item which didn't
work.  I tried setting a prefix="ml" and first-ml_item or first_ml_item but
that didn't work either.

Can I use first- in this scenario?  Is there an easier way of getting unique
values from a list?  Any ideas?

Thanks

-- 
Neil Smith


**********************************************************************
 
The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.
    
If you have received this e-mail in error, please notify postmaster at npower.com (UK 01384 275454) and delete it immediately from your system.
    
Neither Npower nor any of the other companies in the Innogy group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.  Npower Limited Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277. This e-mail may be sent on behalf of a member of the Innogy group of companies.

**********************************************************************




More information about the Zope mailing list