예제 #1
0
파일: note.py 프로젝트: saurabh6790/mango
 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)
예제 #2
0
파일: note.py 프로젝트: saurabh6790/mango
    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)