示例#1
0
 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)
示例#2
0
    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())
示例#3
0
 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)
示例#4
0
 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()