def post(self): output = {"status": 0, "message": ""} _id = self.get_argument('id', 0) try: _id = int(_id) except ValueError: _id = 0 if _id == 0: output["status"] = 1101 output["message"] = "参数ID错误" return self.write(json.dumps(output)) result = UserModel.remove(_id) print type(result) if result: output["status"] = 1 output["message"] = "SUCCESS" else: output["status"] = 1101 output["message"] = "参数ID错误" return self.write(json.dumps(output))