fix unicode encode error

This commit is contained in:
pycook
2019-11-08 14:37:53 +08:00
parent 733ac3b2b4
commit a583433530
5 changed files with 4 additions and 6 deletions

View File

@@ -45,8 +45,8 @@ type_map = {
'serialize': {
Attribute.INT: int,
Attribute.FLOAT: float,
Attribute.TEXT: str,
Attribute.TIME: str,
Attribute.TEXT: lambda x: x if isinstance(x, six.text_type) else str(x),
Attribute.TIME: lambda x: x if isinstance(x, six.text_type) else str(x),
Attribute.DATE: lambda x: x.strftime("%Y-%m-%d"),
Attribute.DATETIME: lambda x: x.strftime("%Y-%m-%d %H:%M:%S"),
},

View File