示例#1
0
def pull_from_teamwork():
    List.clear_task_list()
    TaskObjectBuilder.build_list(
        TaskObjectBuilder.get_from_teamwork(T.tasks, T.tasks_name))
    tsks = List.task_list
    for task in tsks:
        if not DatabaseChecker.does_task_exist_in_db(task):
            if not DatabaseChecker.does_placed_task_exist_in_db(task):
                task.save_to_db()
        elif DatabaseChecker.has_task_been_updated(task):
            # write an update method
            task.update_in_db()
示例#2
0
def pull_from_teamwork():
    List.clear_task_list()
    company = Database.find_one(CompanyConstants.COLLECTION,
                                {"_id": session["company_id"]})

    TaskObjectBuilder.build_list(
        TaskObjectBuilder.get_from_teamwork_scaled(T.tasks, T.tasks_name,
                                                   session["company_name"],
                                                   company["key"]))
    tsks = List.task_list
    for task in tsks:
        if not DatabaseChecker.does_task_exist_in_db(task):
            if not DatabaseChecker.does_placed_task_exist_in_db(task):
                task.save_to_db()
        elif DatabaseChecker.has_task_been_updated(task):
            # write an update method
            task.update_in_db()