def mutate(self, name, todo_list_id): if request.method == "POST": todo_list = TodoListModel.query.get(todo_list_id) todo_item = TodoItemModel(name=name, todo_list=todo_list) todo_item.create() result = Success(yeah='yeah') return CreateTodoItem(result=result)
def do(self): if not self.chat.enabled: return if self.chat.has_no_recent_activity: self.common_reply("to_check_off_help") for text in self.cleaned_lines(): TodoItem.create(chat=self.chat, text=text) self.reply(self.chat.get_formatted_items())
def item(self, **kwargs): chat = kwargs.pop("chat", None) or self.chat() text = kwargs.pop("text", "some") return TodoItem.create(chat=chat, text=text, **kwargs)
def post(self, tid): task = request.form['task'].strip() todo = TodoItem.create(tid, task, current_user) db.session.add(todo) db.session.commit() return todo.to_dict()