Pārlūkot izejas kodu

增加了collection的编辑功能

master
邓淳远 pirms 4 gadiem
vecāks
revīzija
6dce32eb83
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. +11
    -0
      APP/view/collection.py

+ 11
- 0
APP/view/collection.py Parādīt failu

@ -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)

Notiek ielāde…
Atcelt
Saglabāt