Chapter 16.8. Summary
Widgets provide a way to Package HTML, CSS and JavaScript into reusable components.
Widgets are shared between all incoming requests, so they should be stateless.
Widget params can be given defaults at instantiation time, values at render time, or they can be assigned a callable which will be run automatically at render time to get the proper value.
TurboGears provides a form widget which handles displaying its own validation errors.
TurboGears form widgets integrate with FormEncode to handle validation.
FormWidget makes it easy to create your own Validators by subclassing FancyValidator.
The FormWidget is a special case of the more general CompoundWidget, which you can use to create nested widget structures of your own.
CSSLink ...
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.