def change_status_of_childs_tasks(cls, id): try: all_tasks = TaskFunctions.get_all_task() for task in all_tasks: if task.parent_task_id == id: update_task = Task(id=task.id, status="Выполнено", comment=None, date_of_create=None, priority=None, time_of_create=None, header=None, is_under_task=None, owner=None, parent_task_id=None, tags=None, is_linked=None, linked_task_id=None, expert=None, is_parent_task=None, under_task_id=None, time_of_start=None, date_of_end=None, date_of_start=None, time_of_end=None) TaskFunctions.change_task_status(update_task) except: pass
def delete_all_childs_of_task(cls, task_id): try: tasks = TaskFunctions.get_all_task() for delete_task in tasks: if delete_task.parent_task_id == int(task_id): TaskFunctions.delete_task(delete_task.id) except: pass
def delete_form_childs_task_id(cls, task_id): try: tasks = TaskFunctions.get_all_task() for delete_task in tasks: is_task_child = HelpMethods.find_sub_sting_in_string( delete_task.under_task_id, task_id) if is_task_child: new_under_task_id = HelpMethods.delete_sub_string_in_string( delete_task.under_task_id, task_id) if new_under_task_id == '': task = Task(id=delete_task.id, under_task_id='None', is_parent_task='None', expert='None', comment=None, date_of_create=None, priority=None, date_of_end=None, date_of_start=None, time_of_create=None, time_of_end=None, header=None, is_under_task=None, owner=None, parent_task_id=None, status=None, tags=None, time_of_start=None, is_linked=None, linked_task_id=None) TaskFunctions.actions_child(task) else: task = Task(id=delete_task.id, under_task_id=new_under_task_id, is_parent_task='Yes', comment=None, date_of_create=None, priority=None, date_of_end=None, date_of_start=None, time_of_create=None, time_of_end=None, header=None, is_under_task=None, owner=None, parent_task_id=None, status=None, tags=None, time_of_start=None, is_linked=None, linked_task_id=None, expert=None) TaskFunctions.actions_child(task) except: pass
def print_archive(cls, login, password): "Yes" tasks = TaskFunctions.get_all_task() is_valid_user = UsersFunctions.get_user_by_login_and_password( login, password) if is_valid_user is None: print("Пароль или логин введен неверно") else: for task in tasks: is_archive = ArchiveTask.is_task_archive(task) if is_archive is True and (task.owner == login or task.expert == login): print(task)