fix unicode encode error

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

View File

@@ -10,7 +10,7 @@ COPY . /data/apps/cmdb
WORKDIR /data/apps/cmdb
RUN yum install -y epel-release \
RUN yum install -y epel-release && yum clean all\
&& yum install -y python-pip \
&& pip install --no-cache-dir -r docs/requirements.txt

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

View File

@@ -3,4 +3,3 @@
from .account import User
from .cmdb import *
from .acl import *