def task_create(): """Add new task to a list.""" task = Task(None) if request.method == "POST": content = request.get_json(silent=True) if not content: abort(400) task.from_dict(content) dynamo.tasks_master.put_item(data=task.as_dict()) return "Task ID: %s" % task.get_id()
def is_given(self, task: Task): for it in self.given_tasks: if it.get_id() == task.get_id(): return True return False