Change id type to make it consistent

According to dict BOOKS, id should be a string instead an int.
This commit is contained in:
Jiahao.Liang
2016-02-26 17:16:33 -08:00
parent abe3c41ade
commit 3e9b82c538

View File

@@ -64,7 +64,7 @@ in pecan):
# HTTP POST /
@index.when(method='POST', template='json')
def index_POST(self, **kw):
id_ = len(BOOKS)
id_ = str(len(BOOKS))
BOOKS[id_] = kw['name']
return dict(id=id_, name=kw['name'])