Commit e7335b91 authored by Jérome Perrin's avatar Jérome Perrin

fixup! *: use key instead of cmp to sort

parent baadac86
......@@ -24,8 +24,5 @@ else:
or career.getStopDate() < to_date :
career_list.append(career)
def date_cmp(a, b):
return cmp(a.getStartDate(), b.getStartDate())
career_list.sort(date_cmp)
career_list.sort(key=lambda a: a.getStartDate())
return career_list
......@@ -88,11 +88,7 @@ for portal_type in portal_type_list:
obj['total'] = line_counter
append(obj)
# sort lines
def cmpType(a, b):
return cmp(a['document_type'], b['document_type'])
line_list.sort(cmpType)
line_list.sort(key=lambda a:a['document_type'])
# build stat line
obj = Object(uid="new_")
......
......@@ -31,9 +31,6 @@ dest_event_list = portal.portal_catalog(portal_type=event_type_list, default_des
event_list = list(source_event_list)+list(dest_event_list)
def sortDate(a, b):
return cmp(a.getStartDate(), b.getStartDate())
event_list.sort(sortDate)
event_list.sort(key=lambda a: a.getStartDate())
return event_list
......@@ -23,13 +23,10 @@ full_total_price = 0
worker_column_list = []
source_trade_dict = {}
def sortMovement(a, b):
return cmp(a.getRelativeUrl(), b.getRelativeUrl())
movement_type_list = context.getPortalMovementTypeList()
line_list = [x for x in context.getIndexableChildValueList() if x.getPortalType() in \
movement_type_list]
line_list.sort(sortMovement)
line_list.sort(key=lambda line: line.getRelativeUrl())
order_type_list = context.getPortalOrderTypeList()
def getMovementTitle(movement):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment