예제 #1
0
파일: __init__.py 프로젝트: tjphopkins/todo
    def tearDown(self):
        self.app_context.pop()

        User.drop_collection()
        Team.drop_collection()
        Project.drop_collection()
        Item.drop_collection()
        TodoList.drop_collection()
예제 #2
0
파일: api.py 프로젝트: tjphopkins/todo
def todo_lists_dict(project):
    # Get all todo-list items for project to avoid doing a query for each list
    items = Item.get_all_for_project(project)
    todo_lists = defaultdict(list)
    for item in items:
        todo_lists[item.todo_list.id].append(item_dict(item))
    return todo_lists