Exemplo n.º 1
0
def inbox_command():
    """
    Lists all notes and tasks that are still in the 'inbox', i.e. not assigned to projects, tasks or other elements.
    """
    c = conn()
    notes = Note.inbox(c)
    for note in notes:
        print note.display_line()

    tasks = Task.inbox(c)
    for task in tasks:
        print task.display_line()
Exemplo n.º 2
0
            "title" : project.description,
            "state" : "child"
            }

def dict_for_portfolio(portfolio):
    return {
            "name" : "[%d] %s" % (portfolio.id, portfolio.name),
            "title" : portfolio.description,
            "state" : "child"
            }

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)