def add_reply_action(self, environ, start_response): print environ['wsgi.input'] form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ) print form reply = form['reply'].value mId = form['message_id'].value meeplib.add_reply(int(mId), reply) meeplib.saveREPLY() headers = [('Content-type', 'text/html')] headers.append(('Location', '/m/list')) start_response("302 Found", headers) return ["reply added"]
def delete_message_action(self, environ, start_response): print environ['wsgi.input'] form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ) id = int(form['id'].value) print id, ' A' meeplib.delete_message(meeplib.get_message(id)) meeplib.delete_reply(id) meeplib.saveMSG() meeplib.saveREPLY() headers = [('Content-type', 'text/html')] headers.append(('Location', '/')) start_response("302 Found", headers) return ["message deleted"]
def delete_message_action(self, environ, start_response): print environ['wsgi.input'] form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ) id = int(form['id'].value) print id, ' A'; meeplib.delete_message(meeplib.get_message(id)) meeplib.delete_reply(id) meeplib.saveMSG() meeplib.saveREPLY() headers = [('Content-type', 'text/html')] headers.append(('Location', '/')) start_response("302 Found", headers) return ["message deleted"]