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

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.