From 2a047ab65e2c758e61cffda2e9bed30865ab86c9 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Wed, 16 Dec 2009 12:04:48 +0000 Subject: [PATCH] Sort events by alphabetical type name svn: r13823 --- src/plugins/webreport/NarrativeWeb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 5e50513e4..544be4ea4 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -6096,8 +6096,10 @@ def sort_event_types(db, event_types, event_handle_list): for tup_list in event_dict.values(): tup_list.sort() - # return a list of tuples, one per event - return ( (event_type, event_list) for (event_type, event_list) in event_dict.iteritems() ) + # return a list of sorted tuples, one per event + retval = [(event_type, event_list) for (event_type, event_list) in event_dict.iteritems()] + retval.sort(key=lambda item: str(item[0])) + return retval # Modified _get_regular_surname from WebCal.py to get prefix, first name, and suffix def _get_short_name(gender, name):