瀏覽代碼

增加了collection的编辑功能

master
邓淳远 4 年之前
父節點
當前提交
6dce32eb83
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. +11
    -0
      APP/view/collection.py

+ 11
- 0
APP/view/collection.py 查看文件

@ -224,5 +224,16 @@ def edit():
"""
none的情况请直接返回
"""
if id is None and name is None and tag is None:
ret = {'msg': 'id,name,tag are all none!'}
return json_util.dumps(ret)
try:
db_session.query(Collection).filter(Collection.id == id).update({Collection.name: name, Collection.tag: tag})
db_session.commit()
except BaseException as e:
print(str(e))
ret = {'msg': 'failed!'}
return json_util.dumps(ret)
ret = {'msg': 'succuss'}
return json_util.dumps(ret)

Loading…
取消
儲存