Révision a9ee9454
Ajouté par Nicolas Roche il y a plus de 4 ans
auquotidien/modules/myspace.py | ||
---|---|---|
50 | 50 |
invoices = [] |
51 | 51 |
invoices.extend(Invoice.get_with_indexed_value( |
52 | 52 |
str('user_id'), str(user.id))) |
53 |
|
|
54 |
def cmp_invoice(a, b): |
|
55 |
t = cmp(a.regie_id, b.regie_id) |
|
56 |
if t != 0: |
|
57 |
return t |
|
58 |
return -cmp(a.date, b.date) |
|
59 |
|
|
60 |
invoices.sort(cmp_invoice) |
|
53 |
invoices.sort(key=lambda x: (x.regie_id, -x.date)) |
|
61 | 54 |
|
62 | 55 |
last_regie_id = None |
63 | 56 |
unpaid = False |
... | ... | |
127 | 120 |
for formdef in formdefs: |
128 | 121 |
user_forms.extend(formdef.data_class().get_with_indexed_value( |
129 | 122 |
'user_id', self.user.id)) |
130 |
user_forms.sort(lambda x,y: cmp(x.receipt_time, y.receipt_time))
|
|
123 |
user_forms.sort(key=lambda x: x.receipt_time)
|
|
131 | 124 |
|
132 | 125 |
get_response().set_content_type('application/json') |
133 | 126 |
|
... | ... | |
193 | 186 |
for formdef in formdefs: |
194 | 187 |
user_forms.extend(formdef.data_class().get_with_indexed_value( |
195 | 188 |
'user_id', user.id)) |
196 |
user_forms.sort(lambda x,y: cmp(x.receipt_time, y.receipt_time))
|
|
189 |
user_forms.sort(key=lambda x: x.receipt_time)
|
|
197 | 190 |
|
198 | 191 |
profile_links = [] |
199 | 192 |
if not get_cfg('sp', {}).get('idp-manage-user-attributes', False): |
Formats disponibles : Unified diff
myspace: upgrade sort and remove dedicated display form (#38761)