[Zope] Sorting in Python Script

Stephan Richter srichter@cbu.edu
Thu, 05 Apr 2001 08:53:28 -0500


>I have tried
>objlist.sort('bobobase_modification_time')
>and
>objlist.sort(bobobase_modification_time)

This is really a Python Question. Try this:

def sortByDate(x, y):
     return cmp(x.bobobase_modification_time, y.bobobase_modification_time)

objlist.sort(sortByDate)

Regards,
Stephan


--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development & Technical Project Management