[Zope] Sorting of objectValues within python script

olpa@sybcom.de olpa@sybcom.de
Tue, 2 Oct 2001 18:05:03 +0200 (CEST)


On Today, Michael Murphy wrote:

> Delivered-To: olpa@sybcom.de
> Subject: Re: [Zope] Sorting of objectValues within python script
> Date: Tue, 2 Oct 2001 08:01:02 -0700
> To: olpa@sybcom.de, zope@zope.org
> From: Michael Murphy <mike@flipper.eskimo.net>
>
> How about:
>
> sorted_list = list.sort(lambda x, y: cmp(x.getId(), y.getId())
>
> Where list is your list of objectValues.

that's it! but list.sort(blabla) does not return a list, but sorts
the list itself! but that is ok.

i really should look further into the lambda thing in python!

Thank you!

---
   I think we dream so we don't have to be apart so long. If we're in each
other's dreams, we can play together all night.	  -- Calvin
---
 Oliver Pabst             .-------------------------.
 mailto:olpa@sybcom.de    :                         :
 phone :+49 681 56600600  :    project department   :          SYBCOM GmbH
 fax   :+49 681 56600660  :                         : http://www.sybcom.de