Extensible CheckBoxList is a TurboGears widget - virtually identical to a CheckBoxList, except that the user can add as many hand-specified list options as desired.

Every time something is added to the Other: box and the focus is moved, the new item appears in the list and the Other: box is cleared to receive more.

To install, get easy_install and type easy_install xcbl

To use, include something like this in your form's WidgetsList:
pets = ExtensibleCheckBoxList(options=['cats','dogs','turtles'])

To put added options in the "right" place, xcbl relies on insertSiblingNodesBefore, a function from MochiKit 1.4. If you only have MochiKit 1.3 - which currently ships with TurboGears - the new options will go after "Other:", which looks goofy.

There are more sophisticated ways to upgrade your MochiKit, but I did it simply by copying the packed MochiKit.js from http://svn.mochikit.com/mochikit/trunk/packed/MochiKit/MochiKit.js to /usr/lib/python2.4/site-packages/TurboGears-1.0b1-py2.4.egg/turbogears/static/js/MochiKit.js

- Catherine Devlin, May 9, 2007

blog