[Zope-CMF] Sorting objects by specific variable

Andreas Jung Andreas Jung <andreas@andreas-jung.com>
Wed, 07 May 2003 12:47:50 +0200


No problem with the module here.  Check and run the corresponding unittests 
to see
how it works.

-aj

--On Mittwoch, 7. Mai 2003 12:41 Uhr +0200 Gitte Wange 
<gitte@mmmanager.org> wrote:

> On Wednesday 07 May 2003 11:58 am, Gitte Wange wrote:
>> Hello,
>>
>> I have tried searching the archives for an answer, but did not find
>> anything ... so here goes:
>>
>> How do I sort objects by a specific variable ?
>
> I found an old posting giving this solution:
> -------------------------------------------------------------------------
>## parameters=pType,alphaBy
>
> objects = context.contentValues(filter={'portal_type':pType})
>
> sequence.sort(raw_items, ((alphaBy, 'cmp', 'asc'),))
>
> return objects
> -------------------------------------------------------------------------
>
> But it doesn't seem to sort anything :-(
>
> --
> Gitte Wange
> Technical Manager
>
> Email: gitte@mmmanager.org
> Web: http://www.mmmanager.org
> Tlf: +45 36 46 20 02
>
> Python 2.0 beta 1 is now available from BeOpen PythonLabs.
> There is a long list of new features since Python 1.6,
> released earlier today. We don't plan on any new releases
> in the next 24 hours.
>
>     -- Jeremy Hylton, in the 2.0b1 announcement, 5 Sep 2000
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests