def post_note(): note = Note() note.message = bottle.request.forms.get("message") note.hashtags = extract_hashtags(note.message) persistence.insert_note(note) bottle.redirect("")
def add_note(self, message, user): if message: note = Note(activity=self.object) note.message = message note.user = user note.save() messages.success(self.request, 'Note added successfully.') return True else: messages.error(self.request, 'Message cannot be empty.') return False