def post(self): email_id= self.get_argument('email') print 'mail id',email_id if not email_id: self.finish() user_id = self.session['user_id'] email = Email.find(to_user_id = str(user_id), _id = email_id) if email == None: self.finish() return message = {"status":"success", "email":str(email.content)} self.finish(json.dumps(message))
def post(self): email_id = self.get_argument('email') print 'mail id', email_id if not email_id: self.finish() user_id = self.session['user_id'] email = Email.find(to_user_id=str(user_id), _id=email_id) if email == None: self.finish() return message = {"status": "success", "email": str(email.content)} self.finish(json.dumps(message))
def post(self): user_id = self.session['user_id'] email_id= self.get_argument('email_id') Email.find(_id = email_id, to_user_id = str(user_id)).remove() message = {"status":"success"} self.finish(json.dumps(message))
def post(self): user_id = self.session['user_id'] email_id = self.get_argument('email_id') Email.find(_id=email_id, to_user_id=str(user_id)).remove() message = {"status": "success"} self.finish(json.dumps(message))