There's more...

The web.mixins namespace defines a couple of very helpful mixin classes that you should not miss out on when developing form widgets. You already used these mixins in this recipe. The AbstractField is created by inheriting from the Widget class, and the Widget class inherits two mixins. The first one is EventDispatcherMixin, which offers a simple interface for attaching event handlers and triggering them. The second one is ServicesMixin, which provides functions for RPC calls and actions.

When you want to override a method, always study the base class to see what the function is supposed to return. A very common cause of bugs is forgetting to return the super user's deferred object, which causes trouble with asynchronous operations.

Widgets are responsible for validation. Use the isValid function to implement your customization of this aspect.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset