[gen] Stop using param 'cmp' in method [].sort (deprecated in Python3). Used para 'key' instead.
This commit is contained in:
parent
b3ff087e8f
commit
cb77418dda
|
@ -302,7 +302,7 @@ class Calendar(Type):
|
||||||
singleRes = (date, event)
|
singleRes = (date, event)
|
||||||
res.append(singleRes)
|
res.append(singleRes)
|
||||||
# Sort the result if required
|
# Sort the result if required
|
||||||
if sorted: res.sort(lambda x,y: cmp(x[0], y[0]))
|
if sorted: res.sort(key=lambda x: x[0])
|
||||||
# Group events spanned on several days if required
|
# Group events spanned on several days if required
|
||||||
if groupSpanned:
|
if groupSpanned:
|
||||||
# Browse events in reverse order and merge them when appropriate
|
# Browse events in reverse order and merge them when appropriate
|
||||||
|
|
|
@ -177,9 +177,8 @@ class AbstractWrapper(object):
|
||||||
refs = getattr(self.o, fieldName, None)
|
refs = getattr(self.o, fieldName, None)
|
||||||
if not refs: return
|
if not refs: return
|
||||||
tool = self.tool
|
tool = self.tool
|
||||||
refs.sort(lambda x,y: cmp(getattr(tool.getObject(x), sortKey),
|
refs.sort(key=lambda x: getattr(tool.getObject(x), sortKey),
|
||||||
getattr(tool.getObject(y), sortKey)))
|
reverse=reverse)
|
||||||
if reverse: refs.reverse()
|
|
||||||
|
|
||||||
def create(self, fieldNameOrClass, noSecurity=False, **kwargs):
|
def create(self, fieldNameOrClass, noSecurity=False, **kwargs):
|
||||||
'''If p_fieldNameOrClass is the name of a field, this method allows to
|
'''If p_fieldNameOrClass is the name of a field, this method allows to
|
||||||
|
|
Loading…
Reference in a new issue