[Zope] sort in python script dynamically?

Jaroslav Lukesh lukesh at seznam.cz
Fri Jan 9 04:57:09 EST 2004


Andreas Jung wrote:
> 
> 
> --On Freitag, 9. Januar 2004 8:46 Uhr +0100 Jaroslav Lukesh 
> <lukesh at seznam.cz> wrote:
> 
>> Andreas Jung wrote:
>>
>>> Python: somelist.sort(cmpmethod)
>>> Zope: sequence.sort()
>>>
>>> Both methods are well documented.
>>
>>
>> Hi Andreas,
>>
>> I am not big pythonist, just little beginner and I was think that object
>> language was able to do
>>
>>     for i in self.objectItems('Folder').sort()
>>
>> But it does not. So I was try
>>
>> ids = self.objectIds('Folder')
>> ids = ids.sort()
>> for i in ids :
>>
>>
> See Python documentation: sort() sorts *in-place*

Thanks for explaining, so this without any lambda function works too:

ids = self.objectIds('Folder')
ids.sort()
for i in ids :

Regards, JL.





More information about the Zope mailing list