use only nubers if integer contains a mixed string
This commit is contained in:
parent
6fbd090d58
commit
6eb08bd464
1 changed files with 4 additions and 1 deletions
|
@ -130,6 +130,9 @@ class Item(db.Model):
|
|||
sort_type = key.get('sortType', key['type'])
|
||||
if value:
|
||||
if sort_type == 'integer':
|
||||
if isinstance(value, str):
|
||||
value = int(re.sub('[^0-9]', '', value))
|
||||
else:
|
||||
value = int(value)
|
||||
elif sort_type == 'float':
|
||||
value = float(value)
|
||||
|
|
Loading…
Reference in a new issue