summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2012-08-27 09:26:29 (GMT)
committerFrédéric Péters <fpeters@0d.be>2012-08-27 09:26:29 (GMT)
commitaec70024c5be94bbf0e9fbcb23a30ce7431d6383 (patch)
treec44e8c86d087f72942d8fdea37b1f38e22b900a3
parent45d30d4e13f5b2378c64723ee4b3cadb5828b599 (diff)
downloadtabellio.searchform-aec70024c5be94bbf0e9fbcb23a30ce7431d6383.zip
tabellio.searchform-aec70024c5be94bbf0e9fbcb23a30ce7431d6383.tar.gz
tabellio.searchform-aec70024c5be94bbf0e9fbcb23a30ce7431d6383.tar.bz2
sort: if session is equal, and there's no number, use the date
-rw-r--r--tabellio/searchform/cmpfunctions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tabellio/searchform/cmpfunctions.py b/tabellio/searchform/cmpfunctions.py
index deca707..71448db 100644
--- a/tabellio/searchform/cmpfunctions.py
+++ b/tabellio/searchform/cmpfunctions.py
@@ -112,5 +112,7 @@ class Cmp:
t = -cmp(get_no_as_int(x.no), get_no_as_int(y.no))
if t == 0 and hasattr(x, 'nodoc'):
t = cmp(x.nodoc, y.nodoc)
+ elif t == 0 and hasattr(x, 'date'):
+ t = cmp(x.date, y.date)
return t