sort ods by 'commune' and 'voie' columns (#9925)

This commit is contained in:
Serghei Mihai 2016-02-11 10:26:57 +01:00 committed by Frédéric Péters
parent ea51cd37bc
commit f16fe9fb5b
1 changed files with 3 additions and 0 deletions

View File

@ -117,6 +117,9 @@ def email_sectors(formdatas, when):
for i, e in enumerate(header):
ws.write(0, i, e)
# sort by "commune" and "voie" fields
data.sort(key=lambda e: (e[0], e[4]))
for i, d in enumerate(data):
for j, e in enumerate(d):
ws.write(i+1, j, e)