Chapter 17.5. Decorators

As you have already seen in the first few sections of the book, TurboGears makes extensive use of Python decorators to minimize boilerplate and promote the DRY (Don’t Repeat Yourself) principle. And we’ve already covered the expose() and validate() decorators. But don’t let the simplicity of their application programming interface (API) fool you. There’s a lot going on under the hood, and it will be well worth our time to delve into some of their secrets because they can definitely help you create better and more flexible controller methods.

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.