0001238: Web report: sort references for places and media (use locale.strcoll for sorting)

svn: r9162
This commit is contained in:
Brian Matherly
2007-10-12 12:16:49 +00:00
parent 4c2e57cb2e
commit 563298e7c8
3 changed files with 19 additions and 20 deletions

View File

@@ -128,4 +128,13 @@ class Sort:
return 0
a_obj = self.database.get_place_from_handle(a_id)
b_obj = self.database.get_place_from_handle(b_id)
return cmp(a_obj.title, b_obj.title)
return locale.strcoll(a_obj.title, b_obj.title)
def by_media_title(self,a_id,b_id):
"""Sort routine for comparing two media objects by their title. """
if not (a_id and b_id):
return False
a = self.database.get_object_from_handle(a_id)
b = self.database.get_object_from_handle(b_id)
return locale.strcoll(a.desc,b.desc)