Re: [Zope] sorting ids in python

2008-12-11 Thread Andreas Jung
On 11.12.2008 12:28 Uhr, Peter Bengtsson wrote: Personally I prefer to always use objectValues(). Sorting isn't objectXXX()'s problem. It's something you do in your view. objs = list(self.objectValues()) objs.sort(lambda x,y: cmp(x.id, y.id)) Never ever use obj.id. The official API is obj.getI

Re: [Zope] sorting ids in python

2008-12-11 Thread Peter Bengtsson
2008/12/11 robert rottermann <[EMAIL PROTECTED]>: > Garry Saddington schrieb: >> On Tuesday 09 December 2008 03:15, Andreas Jung wrote: >>> On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: > Can anyone help me sort the following by id in a python script? > >>

Re: [Zope] sorting ids in python

2008-12-11 Thread robert rottermann
Garry Saddington schrieb: > On Tuesday 09 December 2008 03:15, Andreas Jung wrote: >> On 08.12.2008 21:11 Uhr, robert rottermann wrote: >>> Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML >>

Re: [Zope] sorting ids in python

2008-12-09 Thread Andreas Jung
On 09.12.2008 8:45 Uhr, Garry Saddington wrote: On Tuesday 09 December 2008 03:15, Andreas Jung wrote: On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTM

Re: [Zope] sorting ids in python

2008-12-09 Thread Garry Saddington
On Tuesday 09 December 2008 03:15, Andreas Jung wrote: > On 08.12.2008 21:11 Uhr, robert rottermann wrote: > > Garry Saddington schrieb: > >> Can anyone help me sort the following by id in a python script? > >> > >> for object in context.objectValues(['Folder', 'DTML > >> Document','ZipFolder','Fil

Re: [Zope] sorting ids in python

2008-12-08 Thread robert rottermann
Andreas Jung schrieb: > On 08.12.2008 21:11 Uhr, robert rottermann wrote: >> Garry Saddington schrieb: >>> Can anyone help me sort the following by id in a python script? >>> >>> for object in context.objectValues(['Folder', 'DTML >>> Document','ZipFolder','File','Image']): >> >> objs=context.objec

Re: [Zope] sorting ids in python

2008-12-08 Thread Andreas Jung
On 08.12.2008 21:11 Uhr, robert rottermann wrote: Garry Saddington schrieb: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): objs=context.objectValues(['Folder', 'DTMLDocument','ZipFolde

Re: [Zope] sorting ids in python

2008-12-08 Thread robert rottermann
Garry Saddington schrieb: > Can anyone help me sort the following by id in a python script? > > for object in context.objectValues(['Folder', 'DTML > Document','ZipFolder','File','Image']): objs=context.objectValues(['Folder', 'DTMLDocument','ZipFolder','File','Image']) objs.sort() for o in objs

Re: [Zope] sorting ids in python

2008-12-08 Thread Andreas Jung
On 08.12.2008 19:23 Uhr, Andreas Jung wrote: On 08.12.2008 18:18 Uhr, Garry Saddington wrote: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): ids = context.objectIds() Possibly you

Re: [Zope] sorting ids in python

2008-12-08 Thread Andreas Jung
On 08.12.2008 18:18 Uhr, Garry Saddington wrote: Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): ids = context.objectIds() ids.sort() -aj begin:vcard fn:Andreas Jung n:Jung;Andreas or

[Zope] sorting ids in python

2008-12-08 Thread Garry Saddington
Can anyone help me sort the following by id in a python script? for object in context.objectValues(['Folder', 'DTML Document','ZipFolder','File','Image']): Import of sequence is not authorised in my python scripts, I am presuming (probably wrongly) that sequence is needed for sort. Regards Garr