def get(self, obj_id): try: Todo.objects(id=obj_id).delete() except: redirect(url_for('todo.list', message=u'Delete Fail!!!')) return redirect(url_for('todo.list'))
def get(self): return render_template('todo/list.html', todos = Todo.objects(done=None, poster=ObjectId(session["user_id"])).order_by('end'), dones=Todo.objects(done=True, poster=ObjectId(session["user_id"])).order_by('end'))
def get(self, condition): try: todos = Todo.objects(topic__contains=condition) except: return redirect(url_for('todo.list', error='Search Fail!')) return render_template('todo/search_result.html', todos=todos)