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'])
|
sort_type = key.get('sortType', key['type'])
|
||||||
if value:
|
if value:
|
||||||
if sort_type == 'integer':
|
if sort_type == 'integer':
|
||||||
|
if isinstance(value, str):
|
||||||
|
value = int(re.sub('[^0-9]', '', value))
|
||||||
|
else:
|
||||||
value = int(value)
|
value = int(value)
|
||||||
elif sort_type == 'float':
|
elif sort_type == 'float':
|
||||||
value = float(value)
|
value = float(value)
|
||||||
|
|
Loading…
Add table
Reference in a new issue