You can see this bug by putting the following in a controller:
myForm = TableForm(widgets=[TextField('title')])
and then passing that to a template via the returned dict, then
inserting the form in the template.
It became obvious pretty quickly that something in TG was doing the
equivalent of 'repr(getattr('some string', 'title')), and putting it
into the value displayed in the field. In fact, changing 'title' to
'upper' resulted in '<built-in method upper of str object at
0xb7b416a0>'. However, changing 'title' to 'foobar' results in an
empty field, which lead me to believe the code was doing the equivalent
of 'repr(getattr('some string', 'foobar', ''))' or possibly
'repr(getattr('some string', 'foobar', None))'.
After spending some time with the code, I found the following in the
template for the TableForm widget (line 138 widgets/forms.py):
<td>${widget.insert(getattr(self.widget_value, widget.name, None),
input_values, widget_error.get(widget.name, None))}</td>
After some study, I've determined that the intent of this code is to
pass the current value of a widget on the form (in this case, a
TextField widget) to the insert method of that widget. Changing the
first argument of the above insert call to None results in an empty
field being displayed rather than the '<build-in method...' text, but
obviously if the TextField widget has a value, it will not be
displayed. I can change the first argument to widget.default, and get
the default value of the widget displayed in the field, but I'm not
sure this exactly fills the intent of the code.
At this point, I suppose Kevin will need to take a look at this code
and determine what the actual intent is before a patch can be generated.