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 5.2. Listing by Category

Let’s change our list controller to return all the categories from the database, and then we’ll iterate over that in the template. First, however, we need some data in our database so that we’ll have something to see when we get this code written.

We could easily add more sample data from the command line. But it’s time to introduce another set of tools that come with TurboGears. If you run tg-admin toolbox, a special TurboGears application called the Toolbox starts.

The Toolbox contains the easiest way to add data to your application during development. The CatWalk tool works with all the databases that TurboGears supports, including SQLite, MySQL, and PostgreSQL. If you start the Toolbox from the root ...

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