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

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.