[Zope] Newbie needs help

Geir Bækholt Geir Bækholt <geirh@funcom.com>
Mon, 3 Feb 2003 16:01:51 +0100


on or about, Monday, February 03, 2003, we have reason to believe that Mich=
el Combe wrote
something along the lines of :
> Hi,

> What I want to do is display, from the result of an SQL query, each first
> occurence of a supplier name .
> ie : I have a query which returns for example "s1,s1,s1,s2,s2,s3,s3" and I
> want to display "s1,s2,s3".

use a script(python) for things like this :

suppliers =3D context.SQL_SelectSupplier()
# pass parameters as needed ;)
distincts =3D []
for i in suppliers:
    if not i.SupplierName in distincts:
        distincts.append(i.SupplierName)
return distincts

:)


--=20
Geir B=E6kholt        geir@funcom.com
Web Application/HCI-designer
Product Operations
Funcom Oslo