def portfolios(self): return Portfolio.all(conn())
def portfolios_command(): c = conn() portfolios = Portfolio.all(c) for portfolio in portfolios: print portfolio.display_line()
inbox = { "name" : "inbox", "children" : [{ "name" : "inbox", "children" : [dict_for_task(t) for t in Task.inbox(conn)] }] } data = { "name" : 'ado', "children" : [inbox] } for portfolio in Portfolio.all(conn): projects = [] for project in portfolio.projects(): tasks = [dict_for_task(t) for t in project.tasks()] project_info = dict_for_project(project) if len(tasks) > 0: project_info["children"] = tasks else: project_info["size"] = 1 projects.append(project_info) portfolio_info = dict_for_portfolio(portfolio)