If value starts with 000045535 will render 45535
should use json.loads(value) insted try int and float here
import json
@staticmethod
def _fromstring(value):
'''Convert XML string value to None, boolean, int or float'''
# NOTE: Is this even possible ?
if value is None:
return None
# FIXME: In XML, booleans are either 0/false or 1/true (lower-case !)
if value.lower() == 'true':
return True
elif value.lower() == 'false':
return False
# FIXME: Using int() or float() is eating whitespaces unintendedly here
try:
return json.loads(value)
except ValueError:
return value
If value starts with 000045535 will render 45535 should use json.loads(value) insted try int and float here