Fix unicode values read from json input on python 2.5
This commit is contained in:
parent
a29633c846
commit
c69d002acb
@ -164,6 +164,13 @@ def str_fromjson(datatype, value):
|
|||||||
return value.encode('utf8')
|
return value.encode('utf8')
|
||||||
|
|
||||||
|
|
||||||
|
@fromjson.when_object(wsme.types.text)
|
||||||
|
def text_fromjson(datatype, value):
|
||||||
|
if value is not None and isinstance(value, wsme.types.bytes):
|
||||||
|
return wsme.types.text(value)
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
@fromjson.when_object(decimal.Decimal)
|
@fromjson.when_object(decimal.Decimal)
|
||||||
def decimal_fromjson(datatype, value):
|
def decimal_fromjson(datatype, value):
|
||||||
if value is None:
|
if value is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user