Ensure dates are sorted by key. Bug #5493

svn: r18822
This commit is contained in:
Gary Burton 2012-02-05 12:58:05 +00:00
parent fd706ae824
commit 2ff608e798

View File

@ -158,14 +158,16 @@ class Sort(object):
return 0
a_obj = self.database.get_event_from_handle(a_id)
b_obj = self.database.get_event_from_handle(b_id)
return cmp(a_obj.get_date_object(), b_obj.get_date_object())
dsv1 = a_obj.get_date_object().get_sort_value()
dsv2 = b_obj.get_date_object().get_sort_value()
return cmp(dsv1, dsv2)
def by_date_key(self, a_id):
"""Sort routine for comparing two events by their dates. """
if not a_id:
return 0
a_obj = self.database.get_event_from_handle(a_id)
return a_obj.get_date_object()
return a_obj.get_date_object().get_sort_value()
def by_place_title(self, a_id, b_id):
"""Sort routine for comparing two places. """