O'Reilly logo

Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites by Gigi Sayfan, Kevin Dangoor, Mark Ramm

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required