Chapter 16.4. Widgets and Validation

We briefly saw how validation works in Chapter 5, but there’s a lot more power and flexibility in the validation library TurboGears uses than we’ve had a chance to cover. Not only that, widgets have some special built-in features that help make form validation even easier and more painless.

Widget-based forms automatically handle validation errors, display error messages, and translate data from Python objects into the strings used in the form, and back again when the form is processed. We’ve already seen most of this in action in Chapter 5, so you probably have a general idea of what happens. But in the next few pages we’re going to peel the covers back a bit and take a look at how all of this works ...

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.