sort() on a sequence does not return anything.  It operates on the
[mutable] sequence in place.

You probably want to push this bit into a python script where you have
more elbow room, and do this:

files.sort(etc,etc)
return files[0]

hth,
Jim
 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
> Behalf Of Kate Legere
> Sent: Tuesday, May 31, 2005 3:35 PM
> To: Zope
> Subject: [Zope] python question
> 
> I may be asking this in the wrong place but I have a tal page 
> where I want to use python to display only the most recent 
> addition to a folder of files.
> 
> 
> I can sort the folder and return all the files easily with:
>  return sequence.sort(files, (('bobobase_modification_time', 'cmp',
> 'desc'),))
> 
> How do I return just the most recent one? (I tried sorting 
> and then using return max(files) but that doesn't give me all 
> the properties and I need them for display) 
> 
> Kate
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to