From: Radek Czajka Date: Thu, 1 Sep 2011 09:38:07 +0000 (+0200) Subject: sortify fix X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/0966a5718a1735d063c8f99471138c2b1924f2b7?hp=cce0cc98d6a95c2fd1517dca73ca2c3b682318f9 sortify fix --- diff --git a/lib/sortify.py b/lib/sortify.py index c64668b26..46e72d226 100755 --- a/lib/sortify.py +++ b/lib/sortify.py @@ -25,7 +25,7 @@ def sortify(value): Examples : - >>> sortify('aa') < sortify('a a') < sortify('ą') < sortify('b') + >>> sortify('a a') < sortify('aa') < sortify('ą') < sortify('b') True >>> sortify('ź') < sortify('ż') @@ -39,6 +39,6 @@ def sortify(value): # try to replace chars value = re.sub('[^a-zA-Z0-9\\s\\-]{1}', replace_char, value) value = value.lower() - value = re.sub(r'[^a-z0-9~]+', '|', value) + value = re.sub(r'[^a-z0-9~]+', ' ', value) return value.encode('ascii', 'ignore')