Chapter 7.1.2. Exploring the Dashboard Index

After the user has been authenticated, the main body of the index method is evaluated:

@tg.expose(template="whatwhat.templates.dashboard.index")
def index(self):
    all_projects = Project.select("parent_project_id is Null" +
                                  "order by upper(name)"

    projects = [project for project in all_projects if not project.archived]

    archived_projects = [project for project in all_projects
                         if project.archived]

    people = Person.select(orderBy='displayName')

    return dict(active_section='dashboard',
                projects=projects,
                archived_projects=archived_projects,
                people=people,
                status_codes=status_codes)

DashboardController’s index method is concerned with getting each of the top-level projects from the Projects table and sorting ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.