def POST(self): form = self.message_form() if not form.validates(): # FAILURE return render.pvz_messages( list(pvz.messages.get_all()), form) else: # SUCCESS msg = { 'text': form['text'].value, 'cta': form['cta']. value } pvz.messages.put_message(msg) raise web.seeother('/ui/messages/pvz')
def GET(self): return render.pvz_messages( list(pvz.messages.get_all()), self.message_form())