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 3.4. Understanding CherryPy and TurboGears Controllers

At the center of a TurboGears application is CherryPy, responding to every user action and sending changes to the model and view.

In other words, CherryPy provides the controller part of the MVC paradigm in TurboGears, and that means that it is responsible for parsing user actions and passing state-change requests to your model objects. It also calls the view template and can pass it whatever data it needs to present to the user.

It sounds like a lot, but actually TurboGears makes writing controllers easy.

Although views can pull data from the model, many people prefer to gather up whatever the view needs and pass it into the view as a dictionary.

There are legitimate reasons to ...

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