8950 : sort problem : TypeError: unorderable types: EventRef() < EventRef()

This commit is contained in:
SNoiraud 2015-12-06 11:29:15 +01:00
parent 252aacee41
commit e8a79a8cea

View File

@ -3211,7 +3211,12 @@ class FamilyPages(BasePage):
trow += (tcell1, tcell2) trow += (tcell1, tcell2)
if fam_evt_ref_list: if fam_evt_ref_list:
fam_evt_srt_ref_list = sorted(fam_evt_ref_list) def sort_on_grampsid(obj):
event = self.dbase_.get_event_from_handle(obj.ref)
return event.get_gramps_id()
fam_evt_srt_ref_list = sorted(fam_evt_ref_list,
key=lambda x: sort_on_grampsid(x))
for evt_ref in fam_evt_srt_ref_list: for evt_ref in fam_evt_srt_ref_list:
event = self.dbase_.get_event_from_handle(evt_ref.ref) event = self.dbase_.get_event_from_handle(evt_ref.ref)
if event: if event: