allow sorting "numbers" with spaces
This commit is contained in:
parent
ad3ff81c9a
commit
20baf16413
|
@ -1,3 +1,4 @@
|
|||
import re
|
||||
import Missing
|
||||
from tabellio.documents.typenames import MAPPING
|
||||
from plone.i18n.normalizer.fr import normalizer
|
||||
|
@ -5,6 +6,11 @@ import tabellio.config.utils
|
|||
|
||||
def get_no_as_int(i):
|
||||
if i:
|
||||
if ' ' in i:
|
||||
try:
|
||||
return int(re.match('\d+', i).group()
|
||||
except ValueError:
|
||||
return 99999
|
||||
try:
|
||||
return int(i.split('-')[0])
|
||||
except ValueError:
|
||||
|
|
Reference in New Issue