Browse Source

增加了collection的编辑功能

master
邓淳远 4 years ago
parent
commit
6dce32eb83
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      APP/view/collection.py

+ 11
- 0
APP/view/collection.py View File

@ -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…
Cancel
Save