def delete(self): id = request.args.get('id') # id -> str # user = queryById(User, id) # 是否考虑 id 不存在的情况 # delete(user) flag = deleteById(User, id) return {'state': 'ok', 'flag': flag, 'msg': '删除 {} 成功!'.format(id)}
def delete(self): id = request.args['id'] flag = deleteById(User, id) return {'state': 'ok', 'flag': flag, 'msg': '{}删除成功'.format(id)}