5332: Change sort order of birth dates to include fallback dates

svn: r18373
This commit is contained in:
Nick Hall 2011-10-25 21:37:09 +00:00
parent ffd79401d1
commit a5f2d9a1f6

View File

@ -95,10 +95,9 @@ class ChildModel(gtk.ListStore):
to a string of 10 long prepended with 0 as needed.
This gives correct string sort for years in the millenia around today
"""
event_ref = data.get_birth_ref()
if event_ref and event_ref.ref:
event = self.db.get_event_from_handle(event_ref.ref)
return '%012d' % event.get_date_object().get_sort_value()
birth = get_birth_or_fallback(self.db, data)
if birth:
return '%012d' % birth.get_date_object().get_sort_value()
else:
return '%012d' % 0