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

This commit is contained in:
SNoiraud 2015-12-06 11:24:55 +01:00
parent cfa0e0c4f7
commit b91eb1540a

View File

@ -3209,7 +3209,12 @@ class FamilyPages(BasePage):
trow += (tcell1, tcell2)
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:
event = self.dbase_.get_event_from_handle(evt_ref.ref)
if event: