def post(self): text, source, public = BaseNoteHandler._get_arguments(self) note = Note(text, source, moderation_user=self.current_user, public=public, ) self.orm.add(note) self.orm.commit() self.redirect(self.next or note.url)
def put(self, note_id_string): note = self._get_note(note_id_string) text, source, public = BaseNoteHandler._get_arguments(self) if note.text == text and \ note.public == public and \ note.source == source: self.redirect(self.next or note.url) return note.text = text note.source = source note.public = public note.moderation_user = self.current_user self.orm.commit() self.redirect(self.next or note.url)