O'Reilly logo

Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites by Gigi Sayfan, Kevin Dangoor, Mark Ramm

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16.6. Creating Custom Widgets

We’ve already seen how the creators of the WhatWhat Status project used custom widgets to display and dynamically create editable forms for Project data. You may want to go back and take another look at Chapter 7, “Controllers, Views, and JavaScript in the WhatWhat Status,” to go over those widgets in light of your new insight into how widgets work.

Rather than go over that same ground again in this chapter, we’re going to look at how two very different widgets work.

First, let’s take a look at how TableForm works to render errors, and form fields on the page, and how we could customize the TableForm widget.

Here’s the original TableForm widget code.

class TableForm(Form): template = """ <form ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required