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.1. Updating Our Model

Before we start, let’s think for a second about the result we want. We’re going to have a bunch of links and a bunch of categories; that much is easy, and it’s pretty obvious that categories are going to have more than one link, otherwise there’s not much point in categories!

But are we ever going to have to have multiple categories for one link? I think the answer is yes. There will be some hotels that are also restaurants, some bed and breakfasts that are also historical landmarks, and so on. With that information in hand, we probably need to bite the bullet and create a join table to manage this many-to-many relationship.

Lucky for us, SQLObject’s RelatedJoin functionality makes this amazingly easy: ...

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